Sync two directories quickly with efficient synchronization software.
First, you'll need to import the module using SYNOPSIS. Once you've done that, you can create a new File::DirSync object with various options set to your liking. You can also specify the source and destination directories, as well as any directories to ignore during the sync process.
Once you've set up your File::DirSync object, you can call the rebuild() method to create the necessary cache for faster syncs in the future. After that, you can call the dirsync() method to actually perform the sync between the two directories.
File::DirSync works by ensuring that the entire file structure within the destination directory matches that of the source directory. It will copy files, update time stamps, adjust symlinks, and remove files and directories as required to force consistency. This is all done as quickly as possible, with minimal reads and writes.
The algorithm used to keep the directory structures consistent is a dirsync cache stored within the source structure. This cache is stored within the timestamp information of the directory nodes. No additional checksum files or separate status configurations are required nor created. So it will not affect any files or symlinks within the source_directory nor its descent.
Overall, if you need a reliable and fast way to sync two directories in Perl, File::DirSync is definitely worth considering.
Version 1.22: N/A