Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
i created a dummy .sh file, backed it up by the above command, then deleted it and re-run the command. rsync does not delete the dummy .sh file at the destination!
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.
it would no longer delete files on the destination side.
The man page has the following section related to --delete:
Quote:
You must have asked rsync to send the whole directory (e.g. "dir" or "dir/") without using a wildcard for the directory’s contents (e.g. "dir/*") since the wildcard is expanded by the shell and rsync thus gets a request to transfer individual files, not the files’ parent directory.
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
i believe i am missing something with such a highly configurable program like rsync!
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:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.