|
1 | | -# dmirror |
2 | | -Disk or directory mirroring/cloning tool for Windows, better robocopy |
| 1 | +# Disk/Directory Mirrorer |
| 2 | + |
| 3 | +[](../../releases/latest) |
| 4 | +  |
| 5 | + [](https://www.buymeacoffee.com/sciencediscoverer) |
| 6 | + |
| 7 | +Minimalistic backup utility based on raw Windows API and custom standard libraries optimised for Windows. It has no bloat, only does what it needs to do - mirrors the content of `SRC` (source) folder/drive into `DST` (destination) folder/drive. Better `robocopy` with full hard link support and timestamps preservation. |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +## Usage |
| 12 | + |
| 13 | +To start the mirroring process, just pass `SRC` and `DST` as a command line parameters like this, with no trailing slashes: |
| 14 | + |
| 15 | +``` |
| 16 | +dmirror [SRC] [DST] |
| 17 | +``` |
| 18 | +Then, follow the instructions and confirm the beginning of the process. |
| 19 | + |
| 20 | +### **[WARNING]** Files that are not present in `SRC` are **deleted** from `DST`! Make sure you select the correct destination! |
| 21 | + |
| 22 | +For example, to mirror local disk `D:\` into external HDD `F:\`: |
| 23 | + |
| 24 | +``` |
| 25 | +dmirror D: F: |
| 26 | +``` |
| 27 | + |
| 28 | +To mirror directory structure rooted at `C:\Users\foo\Documents` into `D:\Backup\Documents`: |
| 29 | + |
| 30 | +``` |
| 31 | +dmirror C:\Users\foo\Documents D:\Backup\Documents |
| 32 | +``` |
| 33 | +*Note: use quotes `"D I R"` if `DIR` path contains spaces.* |
| 34 | + |
| 35 | +## Current state |
| 36 | + |
| 37 | +At the present moment this program is in the state of beta version. It does most of the important stuff, while missing some minor features. Currently implemented features are: |
| 38 | + |
| 39 | +* Full hard link support; detection of all hard link groups in the file system and recreation of the groups in `DST` |
| 40 | +* Preservation of all symbolic links |
| 41 | +* Fast file system scanning (241980 files in 2.5 seconds, single core) |
| 42 | +* Preservation of the original file's create/modify/access timestamps |
| 43 | +* Preservation of all directories' attributes |
| 44 | +* Removal of files in `DST` that are not present in `SRC` |
| 45 | +* Updating modified files (modify date and/or size does not match `SRC` file) |
| 46 | +* Skipping unchanged files |
| 47 | +* Separate progress bars for total files and current file transfer |
| 48 | +* Skipping small files' progress bar display, for decreased interface overhead |
| 49 | +* Transfer speed display in `KB/s` |
| 50 | + |
| 51 | +## Missing features |
| 52 | + |
| 53 | +Eventually, if I'll be able to fish out any time, I plan to implement this features: |
| 54 | + |
| 55 | +* Removal of dangling empty directories from `DST` |
| 56 | +* Recreation of empty directories present inside `SRC` in `DST` |
| 57 | +* Preservation of create/modify/access timestamps for all directories |
| 58 | +* Average transfer speed calculation |
| 59 | +* Accurate remaining time estimation |
| 60 | +* "Quiet" mode with no pauses or confirmations (very dangerous!) |
| 61 | +* Display of the currently transferring **BIG FILE**'s name |
| 62 | +* Ability to pause the mirroring process, and resume it later |
| 63 | +* Support for full live system drive mirroring |
| 64 | + |
| 65 | +## Test Results |
| 66 | + |
| 67 | +In my first full scale test this program was able to fully clone my internal non-system `D:\` 931.3 GB SSD drive into external USB 2.0 931.3 GB HDD `F:\` drive in 7 hours 8 minutes and 36 seconds (not counting the file system preprocessing time). The actual amount of data on `D:\` drive was 758 GB. It contained 241979 files (most of them where "localised" websites and photo/video archive). There was no errors or crushes during the whole execution time. Total RAM used was no more than 56 MB. Based on this test, I can make an assumption that this program is pretty dam stable! |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | +*Note: the difference in file count is caused by screenshots that I took after the mirroring started. This screenshots was not scanned initially, so wasn't included in the mirror.* |
| 72 | + |
| 73 | +## How to build |
| 74 | + |
| 75 | +Just double-click the `msvc_build.cmd` file. Yep. As easy as this. Well, that is, if you have your Visual Studio installed, of course. And if your VS `vcvars64.bat` file is located at this path: |
| 76 | + |
| 77 | +``` |
| 78 | +set "bat_dir=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" |
| 79 | +``` |
| 80 | +If not, first of all, make sure the [Visual Studio](https://visualstudio.microsoft.com/downloads/) is installed. In the setup wizard you will see a huge list of useless features and bloat. Only the C++ build tools are actually needed. Switch to `Individual components` and try to find this in the humongous list: |
| 81 | + |
| 82 | +``` |
| 83 | +MSVC vXXX - VS 202X C++ x64/x86 build tools (Latest) |
| 84 | +``` |
| 85 | + |
| 86 | +After this you will have to merely locate the `vcvars64.bat` file and copy-paste the path to it into `msvc_build.cmd`. Then just launch it and wait until it does all the job for you. Yes, you don't even need to install or open the Visual Studio IDE itself. Ever. |
0 commit comments