problem with: rsync --delete

Status
Not open for further replies.

hobi

Dabbler
Joined
Jul 31, 2014
Messages
13
--delete options not worked with local sync:
after command

rsync -r --delete /mnt/GREEN/* /mnt/z/g1

all erased source files and directories are present on destination.

have anybody this problem ?
 
Joined
Jan 9, 2015
Messages
430
#!/bin/notbashingyou
if [ You're running this from the GUI set up ]; then
Check user permissions on destination
if [ You're running this at the command line && Getting Errors ]; then
echo Errors you are getting >> This forum thread
exit
 

saurav

Contributor
Joined
Jul 29, 2012
Messages
139
For --delete, the source must be a directory. Try removing the * at the end of /mnt/GREEN/* (which is redundant anyway, if you think about it).

This is from the manpage for rsync:
--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.
 

hobi

Dabbler
Joined
Jul 31, 2014
Messages
13
For --delete, the source must be a directory. Try removing the * at the end of /mnt/GREEN/* (which is redundant anyway, if you think about it).

This is from the manpage for rsync:

Thank your !
After removing the * at end - all OK.
 
Status
Not open for further replies.
Top