Hi,
I want to use rsync to make daily backups using hard-links.
see here:
http://www.howtoforge.com/backing-up...rsions-history
or here:
http://www.backupcentral.com/wiki/in...sync_snapshots
This works great, but the problem is, that rsync does not output deleted files, but I want to write this information into a log file. Without using the --link-dest option it shows deleted files correctly.
Look at this simple example. cd into an empty directory and execute this script to see what I mean. Is this a bug, or ist this intended to be or am I wrong somethere?
Code:
#!/bin/bash
echo -e "\n --> creating a test source dir with 2 files (file1,file2) in it"
echo -e " --> 1st backup of this dir with rsync (without --link-dest option)"
echo -e " --> the output of rsync shows the 2 created files\n"
mkdir source
touch source/file1
touch source/file2
rsync -av --delete ./source/. ./backup
echo -e "\n --> creating a new file (file3) in source dir"
touch source/file3
echo -e " --> 2nd backup of this dir with rsync (without --link-dest option)"
echo -e " --> the output of rsync shows the new created file (file3)\n"
rsync -av --delete ./source/. ./backup
echo -e "\n --> deleting file1 in source dir"
rm source/file1
echo -e " --> 3rd backup of this dir with rsync (without --link-dest option)"
echo -e " --> the output of rsync shows the deleted file (file1)\n"
rsync -av --delete ./source/. ./backup
echo -e "\n --> now the same procedure with the --link-dest option"
rm -r source
rm -r backup
echo -e " --> creating a test source dir with 2 files (file1,file2) in it"
echo -e " --> 1st backup of this dir with rsync"
echo -e " --> the output of rsync shows the 2 created files\n"
mkdir source
touch source/file1
touch source/file2
rsync -av --delete ./source/. ./backup
echo -e "\n --> creating a new file (file3) in source dir"
touch source/file3
echo -e " --> 2nd backup of this dir with rsync (with --link-dest option)"
echo -e " --> the output of rsync shows the new created file (file3)\n"
rsync -av --delete --link-dest=../backup ./source/. ./backup2
echo -e "\n --> deleting file1 in source dir"
rm source/file1
echo -e " --> 3rd backup of this dir with rsync (with --link-dest option)"
echo -e " --> the output of rsync does not show the deleted file!!! (file1)\n"
rsync -av --delete --link-dest=../backup2 ./source/. ./backup3