Johannes Kastl
2004-Nov-15 14:24 UTC
Problem with --backup and deleting a directory: Two directories created
Hello everyone, Im kinda new to rsync and this list, so if there are any errors in my reqest, please tell me. I want to use rsync to make a backup of a diretory, and use the --backup option. My script looks like this: rsync -ab --suffix=-`date -Iminutes` --backup-dir=rsync_backup --delete --rsh=ssh directoryA directoryB If I run it once, then delete the file directoryA/test/test.file, the directorys directoryB/rsync_backup/test is created, and the file test.file-204-11-15.... is created. So everything works fine. When I delete or rename a directory (e.g. directoryA/test/delete-this), I would have guessed that a directory directoryB/rsync_backup/test/delee-this-2004-11-15... is created, and all the files in the deleted directory are moved to this directory. And the name of the files is changed to file.name-2004-11. At least that is what I would expect. But that doesnt happen. In fact, a directory directoryB/rsync_backup/test/delete-this is created, and the files are copied there. The names are changed correct. But there is also a directory delete-this-2004-11-15... , but it is empty, and no files are copied/moved there afterwards. If there is a direcotry with the same name later again, and it is deleted, the files also go to this directory, and another empty directory is created. QUESTION: Is there an error in my expextations? Why is rsync renaming the directory but there are no files in it? Is there an option I forgot, or some error in my rsync-command? Or is this an error in rsync itself? Thanks in advance, I hope I explained the problem so you can understand. OJ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: OpenPGP digital signature Url : http://lists.samba.org/archive/rsync/attachments/20041115/339a22ab/signature.bin
Wayne Davison
2004-Nov-17 17:13 UTC
Problem with --backup and deleting a directory: Two directories created
On Mon, Nov 15, 2004 at 03:20:46PM +0100, Johannes Kastl wrote:> But there is also a directory delete-this-2004-11-15... , > but it is empty, and no files are copied/moved there afterwards.The erroneous creation of an empty directory was fixed recently in the CVS version of rsync. You can incorporate this fix into a stock 2.6.3, if you like -- just check out the diff of what changed in version 1.108 of receiver.c, which you can browse on the web: http://cvs.samba.org/cgi-bin/cvsweb/rsync/receiver.c Note that rsync does not apply the --suffix value to directory names in the backup area. ..wayne..
Johannes Kastl
2004-Nov-18 11:31 UTC
Problem with --backup and deleting a directory: Two directories created
Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: OpenPGP digital signature Url : http://lists.samba.org/archive/rsync/attachments/20041118/d5dbc2a4/signature-0001.bin