<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<pre wrap="">Hi,
I want to use rsync to make daily backups using hard-links in this way:
rsync -av --delete --link-dest=..<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>backup_old ./source<span class="moz-txt-tag">/</span></i>. ./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 .<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>source<span class="moz-txt-tag">/</span></i>. ./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 .<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>source<span class="moz-txt-tag">/</span></i>. ./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 .<i class="moz-txt-slash"><span class="moz-txt-tag">/</span>source<span class="moz-txt-tag">/</span></i>. ./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
</pre>
</body>
</html>