Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Hi
i am a bit confused first i have a nas storage device and a external hard disk
i mounted the storage device on /mnt
and the external hard drive on /media/disk
my goal is to copy from the storage device to the external hard disk so i did
rsync -vac --stats --delete /mnt/ /media/disk/fileserver-backup/
and this was the out put i was getting
deleting mnt/Contacts/Clients/.............
deleting mnt/Contacts/Clients/...............
deleting mnt/Contacts/Clients/...............
deleting mnt/Contacts/Clients/................
deleting mnt/Contacts/Clients/............
deleting mnt/Contacts/Clients/............
deleting mnt/Contacts/Clients/..............
deleting mnt/Contacts/Clients/..............
deleting mnt/Contacts/Clients/...........
deleting mnt/Contacts/Clients/...........
deleting mnt/Contacts/Clients/..........
deleting mnt/Contacts/Clients/..........
deleting mnt/Contacts/Clients/..........
that is just part of the output before i stopped it also the ......
is for security reasons
my question is why is it deleting the stuff on the storage device when the command stated
rsync [OPTION...] SRC... [DEST]
if it isnt deleting what is on the storage device what is it deleting
i was trying to back up the file on the storage device to the external drive
the external drive had a copy of the backups but it was about a few weeks old
so i was trying to update it so i can work on the storage device
No, --delete deletes at the destination. What's happening is rsync compares what you are sending with what's there and because you have the delete option is cleaning up.
--delete
This tells rsync to delete extraneous files from the receiving side (ones that aren't on the sending side), but only for
the directories that are being synchronized. 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. Files that are excluded
from transfer are also excluded from being deleted unless you use the --delete-excluded option or mark the rules as only
matching on the sending side (see the include/exclude modifiers in the FILTER RULES section).
Prior to rsync 2.6.7, this option would have no effect unless --recursive was in effect. Beginning with 2.6.7, deletions
will also occur when --dirs (-d) is in effect, but only for directories whose contents are being copied.
This option can be dangerous if used incorrectly! It is a very good idea to run first using the --dry-run option (-n) to
see what files would be deleted to make sure important files aren't listed.
If the sending side detects any I/O errors, then the deletion of any files at the destination will be automatically dis‐
abled. This is to prevent temporary filesystem failures (such as NFS errors) on the sending side causing a massive dele‐
tion of files on the destination. You can override this with the --ignore-errors option.
The --delete option may be combined with one of the --delete-WHEN options without conflict, as well as --delete-excluded.
However, if none of the --delete-WHEN options are specified, rsync will currently choose the --delete-before algorithm.
A future version may change this to choose the --delete-during algorithm. See also --delete-after.
So basically it was not deleting my files because it cause me quite a scare and also i checked for the files there were still there but from the out put that was the folders it was supposed to be deleting anyway thanks for you help next time i will definitely use a dry run first
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.