hww@my-domain:~/workspace/rsyncbug$ ll total 36 drwxrwxr-x 4 hww hww 4096 May 26 14:42 ./ drwxrwxr-x 4 hww hww 4096 May 26 13:56 ../ -rw-rw-r-- 1 hww hww 20 May 26 14:36 lastsnapshot drwxrwxr-x 7 hww hww 4096 May 26 14:36 snapshots/ drwxrwxr-x 2 hww hww 4096 May 26 14:23 src/ hww@my-domain:~/workspace/rsyncbug$ cd src hww@my-domain:~/workspace/rsyncbug/src$ ll total 20 drwxrwxr-x 2 hww hww 4096 May 26 14:23 ./ drwxrwxr-x 4 hww hww 4096 May 26 14:42 ../ -rw-rw-r-- 1 hww hww 86 May 26 13:59 first -r--r--r-- 1 hww hww 175 May 26 14:04 second -rw-rw-r-- 1 hww hww 94 May 26 14:02 third hww@my-domain:~/workspace/rsyncbug/src$ cat * This is a non-empty testfile, #1. Its main purpose is to help reproduce an rsync bug. This is a non-empty testfile, #2. This one will have its write permission bit reset, in order to show that rsync will destroy the permission bits under certain circumstances. This is the third non-empty testfile, #3. Its main purpose is to help reproduce an rsync bug. hww@my-domain:~/workspace/rsyncbug/src$ cd ../snapshots/ hww@my-domain:~/workspace/rsyncbug/snapshots$ ll total 8 drwxrwxr-x 2 hww hww 4096 May 26 14:51 ./ drwxrwxr-x 4 hww hww 4096 May 26 14:42 ../ hww@my-domain:~/workspace/rsyncbug/snapshots$ hww@my-domain:~/workspace/rsyncbug/snapshots$ cd .. hww@my-domain:~/workspace/rsyncbug$ snap=`date +%F-%H-%M-%S` && \ > rsync -ar --itemize-changes src/ snapshots/`echo $snap`/ && \ > echo $snap > lastsnapshot cd+++++++++ ./ >f+++++++++ first >f+++++++++ second >f+++++++++ third hww@my-domain:~/workspace/rsyncbug$ cat lastsnapshot 2017-05-26-14-54-39 hww@my-domain:~/workspace/rsyncbug$ ll snapshots total 12 drwxrwxr-x 3 hww hww 4096 May 26 14:54 ./ drwxrwxr-x 4 hww hww 4096 May 26 14:42 ../ drwxrwxr-x 2 hww hww 4096 May 26 14:47 2017-05-26-14-54-39/ hww@my-domain:~/workspace/rsyncbug$ ll snapshots/`cat lastsnapshot` total 20 drwxrwxr-x 2 hww hww 4096 May 26 14:47 ./ drwxrwxr-x 3 hww hww 4096 May 26 14:54 ../ -rw-rw-r-- 1 hww hww 87 May 26 14:46 first -r--r--r-- 1 hww hww 176 May 26 14:47 second -rw-rw-r-- 1 hww hww 95 May 26 14:47 third hww@my-domain:~/workspace/rsyncbug$ hww@my-domain:~/workspace/rsyncbug$ snap=`date +%F-%H-%M-%S` && \ > rsync -ar --itemize-changes --link-dest=`pwd`/snapshots/`cat lastsnapshot`/ src/ snapshots/`echo $snap`/ && \ > echo $snap > lastsnapshot hww@my-domain:~/workspace/rsyncbug$ ... repeat this a couple of times, then hww@my-domain:~/workspace/rsyncbug$ cat lastsnapshot 2017-05-26-15-01-35 hww@my-domain:~/workspace/rsyncbug$ hww@my-domain:~/workspace/rsyncbug$ find snapshots/ -name second -ls 1178241 4 -r--r--r-- 4 hww hww 176 May 26 14:47 snapshots/2017-05-26-15-01-18/second 1178241 4 -r--r--r-- 4 hww hww 176 May 26 14:47 snapshots/2017-05-26-15-00-53/second 1178241 4 -r--r--r-- 4 hww hww 176 May 26 14:47 snapshots/2017-05-26-15-01-35/second 1178241 4 -r--r--r-- 4 hww hww 176 May 26 14:47 snapshots/2017-05-26-14-54-39/second hww@my-domain:~/workspace/rsyncbug$ rsync -r --delete `mktemp -d`/ snapshots/2017-05-26-15-00-53/ hww@my-domain:~/workspace/rsyncbug$ hww@my-domain:~/workspace/rsyncbug$ find snapshots/ -name second -ls 1178241 4 -rw-r--r-- 3 hww hww 176 May 26 14:47 snapshots/2017-05-26-15-01-18/second 1178241 4 -rw-r--r-- 3 hww hww 176 May 26 14:47 snapshots/2017-05-26-15-01-35/second 1178241 4 -rw-r--r-- 3 hww hww 176 May 26 14:47 snapshots/2017-05-26-14-54-39/second hww@my-domain:~/workspace/rsyncbug$ hww@my-domain:~/workspace/rsyncbug$ snap=`date +%F-%H-%M-%S` && > rsync -ar --itemize-changes --link-dest=`pwd`/snapshots/`cat lastsnapshot`/ src/ snapshots/`echo $snap`/ && > echo $snap > lastsnapshot cf...p..... second hww@my-domain:~/workspace/rsyncbug$ hww@my-domain:~/workspace/rsyncbug$ find snapshots/ -name second -ls 1178241 4 -rw-r--r-- 3 hww hww 176 May 26 14:47 snapshots/2017-05-26-15-01-18/second 1178252 4 -r--r--r-- 1 hww hww 176 May 26 14:47 snapshots/2017-05-26-15-18-34/second 1178241 4 -rw-r--r-- 3 hww hww 176 May 26 14:47 snapshots/2017-05-26-15-01-35/second 1178241 4 -rw-r--r-- 3 hww hww 176 May 26 14:47 snapshots/2017-05-26-14-54-39/second hww@my-domain:~/workspace/rsyncbug$