{"id":23407660,"url":"https://github.com/bestia-dev/backup_for_zeljko_egui","last_synced_at":"2025-04-09T00:49:13.012Z","repository":{"id":265491481,"uuid":"896114838","full_name":"bestia-dev/backup_for_zeljko_egui","owner":"bestia-dev","description":"Simple backup program tailored for my friend Željko. Made with rust and egui.","archived":false,"fork":false,"pushed_at":"2025-03-29T15:47:00.000Z","size":1245,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T16:30:05.101Z","etag":null,"topics":["egui","gui","obsolete","rust","tutorial"],"latest_commit_sha":null,"homepage":"https://bestia-dev.github.io/backup_for_zeljko_egui/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bestia-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-29T15:18:07.000Z","updated_at":"2025-03-29T15:47:03.000Z","dependencies_parsed_at":"2025-03-29T16:36:20.795Z","dependency_job_id":null,"html_url":"https://github.com/bestia-dev/backup_for_zeljko_egui","commit_stats":null,"previous_names":["bestia-dev/backup_for_zeljko_egui"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestia-dev%2Fbackup_for_zeljko_egui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestia-dev%2Fbackup_for_zeljko_egui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestia-dev%2Fbackup_for_zeljko_egui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bestia-dev%2Fbackup_for_zeljko_egui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bestia-dev","download_url":"https://codeload.github.com/bestia-dev/backup_for_zeljko_egui/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247953090,"owners_count":21023945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["egui","gui","obsolete","rust","tutorial"],"created_at":"2024-12-22T14:29:18.232Z","updated_at":"2025-04-09T00:49:13.005Z","avatar_url":"https://github.com/bestia-dev.png","language":"Rust","funding_links":["https://paypal.me/LucianoBestia"],"categories":[],"sub_categories":[],"readme":"\u003c!-- markdownlint-disable MD041 --\u003e\n[//]: # (auto_md_to_doc_comments segment start A)\n\n# backup_for_zeljko_egui\n\n[//]: # (auto_cargo_toml_to_md start)\n\n**Simple backup program tailored for my friend Željko. Made with rust and egui.**  \n***version: 2025.331.1419 date: 2025-03-31 author: [bestia.dev](https://bestia.dev) repository: [GitHub](https://github.com/bestia-dev/backup_for_zeljko_egui)***\n\n ![obsolete](https://img.shields.io/badge/obsolete-red)\n ![tutorial](https://img.shields.io/badge/tutorial-orange)\n ![egui](https://img.shields.io/badge/egui-orange)\n ![rust](https://img.shields.io/badge/rust-orange)\n ![gui](https://img.shields.io/badge/gui-orange)\n\n[//]: # (auto_cargo_toml_to_md end)\n\n ![License](https://img.shields.io/badge/license-MIT-blue.svg)\n ![backup_for_zeljko_egui](https://bestia.dev/webpage_hit_counter/get_svg_image/2117022954.svg)\n\nHashtags: #tutorial #egui #rust #gui  \nMy projects on GitHub are more like a tutorial than a finished product: [bestia-dev tutorials](https://github.com/bestia-dev/tutorials_rust_wasm).\n\n## OBSOLETE\n\nThis project was made with \"egui immediate mode GUI\", but I don't really like that.  \nI will rewrite the project with \"iced retained mode GUI\".  \n\n## Backup\n\nMy friend has a laptop with 1TB space for his data.  \nThen a super tiny and extremely fast Samsung T7 Shield 2TB external SSD as primary backup.  \nAnd then a big old 2TB external HDD as secondary backup. It is so big that it has it's own power.  \n\nThe difference in storage size makes the backup tricky. Not impossible, but a notch more complicated that he would like.\n\nI was thinking of using `robocopy` for the backup, but as always it lacks a feature that I would like to have.\nWhen the files are deleted on the `original` disk I want to save these files on the backup disk for possible recovery later. Robocopy just delete them. I know there exists the windows recycle bin, but I don't want to use that.  \n\nFirst the program will check what disks are connected. The names of the folders are fixed so I can recognize them easily. There are 3 different backups:\n\n1. from the laptop d:\\original1 to e:\\backup1_of_original1\n2. from the laptop d:\\original1 to f:\\backup2_of_original1\n3. from the primary backup e:\\original2 to f:\\backup_of_original2\n\nThe files that should be deleted will be moved into a folder named `deleted_on_backup_datetime`. This can be reviewed and finally manually delete when not needed any more.\n\nI will use `robocopy` to list the files to be deleted. Then I will parse the output and move these files.\nThen I will use `robocopy` to make a \"mirror backup\". Sounds easy.\n\n## GUI for windows\n\nMy friend is not a computer guy, so I decided that a CLI program in a terminal is not for him. He is comfortable to use GUI programs in Windows.\n\nI experimented with the crate `egui` to create a super simple GUI program for Windows, but I don't like the \"immediate mode GUI\".  \nI will rewrite it using \"iced retained mode GUI\".\n\n## Cross compile to windows\n\nOn my machine I have Windows11 with WSL/Debian. I will cross compile to Windows, copy the exe file with `scp` and run it on Windows.  \n\nI use `cargo-auto` for automation of the build process and to commit to GitHub. Just run `cargo auto` and follow the instructions. To work with GitHub it will need the Personal Access Token from \u003chttps://github.com/settings/tokens\u003e.  \n\nCopy the exe file from the container 'crustde' to win folder. Run in windows git-bash:\n\n```bash\nscp rustdevuser@crustde:/home/rustdevuser/rustprojects/backup_for_zeljko_egui/target/x86_64-pc-windows-gnu/release/backup_for_zeljko_egui.exe /c/Users/Luciano/rustprojects/backup_for_zeljko_egui/\n\n# then run in git-bash\ncd ~/rustprojects/backup_for_zeljko_egui\n./backup_for_zeljko_egui.exe\n```\n\n## Robocopy\n\nRobocopy stands for \"Robust copy\" in Windows. It is good.  \nFirst I want to list the files that should be deleted.  \nThen I will parse the output and move these files instead of delete them.  \nIn the output I must recognize the files that start with the `destination` folder.\n\n```bash\nrobocopy options\n/L :: List only - don't copy, timestamp or delete any files.\n/X :: report all eXtra files, not just those selected.\n/FP :: include Full Pathname of files in the output.\n/NS :: No Size - don't log file sizes.\n/NC :: No Class - don't log file classes.\n/NDL :: No Directory List - don't log directory names.\n\nrobocopy d:\\original1 d:\\backup1_of_original1 /MIR /L /X /FP /NS /NC /NDL\n\nThe output is terrible to parse:\n-------------------------------------------------------------------------------\n   ROBOCOPY     ::     Robust File Copy for Windows\n-------------------------------------------------------------------------------\n\n  Started : tuesday, 26. november 2024 11:03:11\n   Source : d:\\original1\\\n     Dest : d:\\backup1_of_original1\\\n\n    Files : *.*\n\n  Options : *.* /X /FP /NS /NC /NDL /L /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /R:1000000 /W:30\n\n------------------------------------------------------------------------------\n\n                                d:\\backup1_of_original1\\LF2023-12-15 10-46-45 es alta.jpg\n                                d:\\original1\\LF2023-12-11 11-07-09 Luciano.jpg\n\n------------------------------------------------------------------------------\n\n               Total    Copied   Skipped  Mismatch    FAILED    Extras\n    Dirs :         2         0         2         0         0         0\n   Files :         6         1         5         0         0         2\n   Bytes :   31.83 m    9.06 m   22.77 m         0         0    2.70 m\n   Times :   0:00:00   0:00:00                       0:00:00   0:00:00\n   Ended : tuesday, 26. november 2024 11:03:11\n```\n\n## Open-source and free as a beer\n\nMy open-source projects are free as a beer (MIT license).  \nI just love programming.  \nBut I need also to drink. If you find my projects and tutorials helpful, please buy me a beer by donating to my [PayPal](https://paypal.me/LucianoBestia).  \nYou know the price of a beer in your local bar ;-)  \nSo I can drink a free beer for your health :-)  \n[Na zdravje!](https://translate.google.com/?hl=en\u0026sl=sl\u0026tl=en\u0026text=Na%20zdravje\u0026op=translate) [Alla salute!](https://dictionary.cambridge.org/dictionary/italian-english/alla-salute) [Prost!](https://dictionary.cambridge.org/dictionary/german-english/prost) [Nazdravlje!](https://matadornetwork.com/nights/how-to-say-cheers-in-50-languages/) 🍻\n\n[//bestia.dev](https://bestia.dev)  \n[//github.com/bestia-dev](https://github.com/bestia-dev)  \n[//bestiadev.substack.com](https://bestiadev.substack.com)  \n[//youtube.com/@bestia-dev-tutorials](https://youtube.com/@bestia-dev-tutorials)  \n\n[//]: # (auto_md_to_doc_comments segment end A)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbestia-dev%2Fbackup_for_zeljko_egui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbestia-dev%2Fbackup_for_zeljko_egui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbestia-dev%2Fbackup_for_zeljko_egui/lists"}