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.
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.
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
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
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