Maik Meier
2013-Jan-08 11:23 UTC
rsync in conjunction with the --link-dest option does not output deleted files
Hi, I want to use rsync to make daily backups using hard-links in this way: rsync -av --delete --link-dest=../backup_old ./source/. ./backup_new This works great, but the problem is, that rsync does not show correctly what action it performs (-v option). It shows correctly all new and changed files/folders, but it does not show files that were deleted. This works only if I do not use the -link-dest option. Here is a little example script that shows the problem: #!/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" Does someone know if this a bug, or ist this intended to be or am I wrong somethere? Thanks
Maik Meier
2013-Jan-08 11:31 UTC
rsync in conjunction with the --link-dest option does not output deleted files
Hi, I want to use rsync to make daily backups using hard-links in this way: rsync -av --delete --link-dest=../backup_old ./source/. ./backup_new This works great, but the problem is, that rsync does not show correctly what action it performs (-v option). It shows correctly all new and changed files/folders, but it does not show files that were deleted. This works only if I do not use the -link-dest option. Here is a little example script that shows the problem: #!/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 Does someone know if this a bug, or ist this intended to be or am I wrong somethere? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20130108/210817dd/attachment.html>
Matthias Schniedermeyer
2013-Jan-08 11:33 UTC
rsync in conjunction with the --link-dest option does not output deleted files
On 08.01.2013 12:23, Maik Meier wrote:> Hi, > > I want to use rsync to make daily backups using hard-links in this way: > > rsync -av --delete --link-dest=../backup_old ./source/. ./backup_new > > Does someone know if this a bug, or ist this intended to be or am I > wrong somethere?I would think it is intented. Technically you don't have anything to delete as you are creating something new and a "deleted" file just means that you don't have to link or copy it. -- Matthias
Reasonably Related Threads
- Doubts on incremental backup and command repetition
- [PATCH v2] xfstests: btrfs/316: cross-subvolume sparse copy
- [LLVMdev] Compile units in debugging intrinsics / globals
- [LLVMdev] Redefining function
- [LLVMdev] Compile units in debugging intrinsics / globals