- About
- Get started
- Prerequisites
- Gui
- CLI
- Remarks
This tool helps users to maintain exact copies of a directory.
There are several terms to describe the methods which keeping multiple directories in sync [Art]. We used "file mirroring" as the term to describe what this tool does. Given two directories, one has to be the source, and the other one will be the destination. This tool will modify the destination directory so that it appears the same as the source directory. The source directory will remain unchanged.
This tool is helpful when we want to maintain multiple cold backups. To update the backups, we just need to modify one of the backups. Other backups could be updated by mirroring the first one.
Googling "file sync" we could find loads of file synchronization softwares. They are handy and powerful. However, making a minimal one with a subset of their functionalities is fun. Moreover, we could optimize the synchronization process base on our need. One optimization is to prevent unnecessary coping when the file/directory was renamed or moved in the source directory, without the content being modified. As far as I know, most file synchronization softwares (except those with real-time monotoring) have no knowledge of the situation when the source is being mirrored to the destination directory. These renamed or moved files will be deleted on the destination directory, then copied again from the source directory. This could be optimized by monitoring and remembering the file events on the source directory, which is what this tool does.
Remarks: Current version monitors file renaming events only. Functionality of monitoring moved files will be introduced in the next version.
This tool can be used via both GUI and CLI.
- Download the latest version of the app from the release page.
- Unzip the archive.
- You will find the app in the directory (windows:
file_mirroring.exe
; linux:file_mirroring
).
- Start the app.
- Browse and select the source directory.
- Make changes on the directory.
- After all changes have been made, close the app.
- Start the app.
- Browse and select the source directory.
- Browse and select the destination directory.
- Click the "Synchronize" button.
- Do not modify the source and destination directories before the synchronization process has completed.
- A message dialog will pop up to inform the user when the synchronization process is completed. The message dialog and the app can be closed afterwards.
- (Windows as the example of the environment) Run
file_mirroring.exe <path_to_source_directory>
. - Make changes on the directory.
- After all changes have been made, terminate the program.
- (Windows as the example of the environment) Run
file_mirroring.exe <path_to_source_directory> <destination_directory>
. - Press
Enter
key to start the mirroring process. - Wait until the process has been completed.
- Using this tool will create a
SQLite
database file nameddirectory_name.db
whenever a directory nameddirectory_name
is being selected as the source or destination directory. It is used to cache the file renaming/moving operations so that unnecessary copying could be prevented during file mirroring. Do not delete this file unless all target directories are in sync.