Project

dir_sync

0.0
No commit activity in last 3 years
No release in over 3 years
Multidirectional directory synchronisation for any number of directories
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0
~> 0
~> 2
 Project Readme

<img src=“https://secure.travis-ci.org/markryall/dir_sync.png” />

dir_sync¶ ↑

Produce a script to synchronise two directories. Kind of like unison but a bit simpler.

Usage¶ ↑

dir_sync name folder1 folder2 ...

This will output all require mkdir and cp commands that would be required to sync the folders. It will also produce the index file (~/.dir_sync/NAME) which will be used in subsequent synchronisations to detect deletions. You can then review the commands before executing them (in case they seem likely to do something undesirable). Note that files that differ only in modification time will be overwritten with the most recent one.

drain script1 script2

This simply runs each line in the specified scripts rewriting the script as each command is succesfully executed. This is just so if the script is interrupted or killed, you can resume. Note that the new file will be written to a temp file first (in case the rewriting is interrupted), each command must appear on a single line and it is likely that the command interrupted will be rexecuted.

Together, these scripts can be used as follows:

dir_sync photos /Volumes/BACKUP/sync/photos /Users/Shared/Photos | tee sync.sh
drain sync.sh

Future Plans¶ ↑

  • actually execute file commands perhaps with optional confirmation

  • consider introducing checksums/filesize comparisons to avoid copying identical files that

differ only in modification time.