an rsync question
hello all,
i am using rsync to backup my shell scripts for some time. i just checked the backup destinations and noticed that deleted files at the source still exist at the destination. my rsync command is; Code:
rsync -avz --delete --recursive /home/user/*sh /backup obviously i am doing something wrong, can you please help me find it? |
I wonder if it could be a permissions issue. I tried running the same command only to another directory in my own home directory and it deletes the file as you would expect. You might check permissions for the user on /backup directory.
Regards, Fordeck |
thanks for your reply, fordeck.
i am running the command as root. unfortunately no permissions issue. my OS is Ubuntu Lucid Lynx. very strange that your command runs proper, mine does not delete the originally deleted files :( |
Actually when I tried it I did not use a wildcard match (i.e. /home/user/*sh). In other words I just used:
Code:
rsync -avz --delete --recursive testing/ testing2/ Code:
rsync -avz --delete --recursive testing/*sh testing2/ The man page has the following section related to --delete: Quote:
Fordeck |
hello fordeck,
yes the problem seems the wildcard pattern. however, it is interesting that rsync being so versatile, i can not run it with a pseudo command like: synchronize all *sh files between source & destination directories, source being master and destination being slave. rsync only performs file copy from source to destination when source is a wildcard pattern :confused: i believe i am missing something with such a highly configurable program like rsync! regards, |
Your right rsync being as configurable as it is should be able to do what you are asking. I believe this may be one way to accomplish your task, however you may want to add -n to do a dry run first:
Code:
rsync -avz --delete --include '*sh' --exclude '*' /home/user/ /backup/ Fordeck |
Works!
dear fordeck,
thank you for your support, now rsync works just the way i wanted! i deployed the include & exclude filters. however, one should pay attention to adding character "/" to the end of source and destination dirs; since omitting / directs rsync in a wrong way. hope this thread helps others messing with rsync :) regards, |
All times are GMT -5. The time now is 09:02 AM. |