Prevent rsync from deleting destination files that match a given pattern
You can exclude files/directories with –exclude. This will prevent the somedir directory from being synced/deleted: rsync -avrc –delete –exclude somedir source destination
You can exclude files/directories with –exclude. This will prevent the somedir directory from being synced/deleted: rsync -avrc –delete –exclude somedir source destination
Try this one-liner: rsync -av -e “ssh -A root@proxy ssh” ./src root@target:/dst
The option to ignore NTFS permissions has changed in Cygwin version 1.7. This might be what’s causing the problem. Try adding the ‘noacl’ flag to your Cygwin mounts in C:\cygwin\etc\fstab, for example: none /cygdrive cygdrive user,noacl,posix=0 0 0 You can pass custom permissions via rsync using the ‘chmod’ option: rsync -rvz –chmod=ugo=rwX -e ssh source … Read more
The trick for me was I had ssh conflict. I have Git installed on my Windows path, which includes ssh. cwrsync also installs ssh. The trick is to have make a batch file to set the correct paths: rsync.bat @echo off SETLOCAL SET CWRSYNCHOME=c:\commands\cwrsync SET HOME=c:\Users\Petah\ SET CWOLDPATH=%PATH% SET PATH=%CWRSYNCHOME%\bin;%PATH% %~dp0\cwrsync\bin\rsync.exe %* On Windows you … Read more
I was having the same problem. Removing -v didn’t work for me. My use-case is slightly different in that I’m going from source (EXT4) to ExFAT. The issue for me was that rsync was attempting to preserve device files and permissions, which ExFAT doesn’t support. I was using the -hrltDvaP switches. The -D and -a … Read more
You may be looking for rsync -aR for example: rsync -a –relative /top/a/b/c/d remote:/ See also this trick in other question.
rsync is useful for local file copying as well as between machines. This will do what you want: rsync -avm –include=”*.jar” -f ‘hide,! */’ . /destination_dir The entire directory structure from . is copied to /destination_dir, but only the .jar files are copied. The -a ensures all permissions and times on files are unchanged. The … Read more
It’s described in the rsync(1) manpage: A trailing slash on the source changes this behavior to avoid creating an additional directory level at the destination. You can think of a trailing / on a source as meaning “copy the contents of this directory” as opposed to “copy the directory by name”, but in both cases … Read more
Make sure the user you’re rsync’d into on the remote machine has write access to the contents of the folder AND the folder itself, as rsync tried to update the modification time on the folder itself.