Questions tagged [rsync]

GENERAL RSYNC SUPPORT IS OFF-TOPIC. Support questions may be asked on https://superuser.com. rsync can copy files locally, over ssh or rsh remote shell services, or with a remote rsync daemon. Files can be incrementally updated and rsync provides for file-size and last-modified time update checks. rsync runs on POSIX systems including Linux, BSD, Unix, and Windows (via Cygwin).

Rsync is a file copy utility which runs on POSIX systems, including Linux, BSD, Unix, and Windows (via Cygwin).

rsync is capable of copying files locally and remotely, using ssh or rsh services as transport, or to a remote rsync daemon (non-secure way). rsync uses a delta-transfer algorithm for transferring files. Files can be incrementally updated based on source/destination differences in file-size and/or timestamps, or differences in checksums.

rsync is very suitable for low-bandwidth and high-latency networks as it transfers only the changed part of files.

rsync was developed by Andrew Tridgell and currently is maintained by Wayne Davison.

For more details see http://rsync.samba.org/

2462 questions
514
votes
11 answers

Is it possible to specify a different ssh port when using rsync?

I have been attempting the following command: rsync -rvz --progress --remove-sent-files ./dir user@host:2222/path SSH is running on port 2222, but rsync still tries to use port 22 and then complains about not finding the path, cause of course it…
Ketema
  • 6,108
  • 3
  • 21
  • 24
439
votes
3 answers

Copying files using rsync from remote server to local machine

Once I've ssh'd into my remote server, what would the command be to copy all files from a directory to a local directory on my machine?
markstewie
  • 9,237
  • 10
  • 50
  • 72
351
votes
7 answers

How does `scp` differ from `rsync`?

An article about setting up Ghost blogging says to use scp to copy from my local machine to a remote server: scp -r ghost-0.3 root@*your-server-ip*:~/ However, Railscast 339: Chef Solo Basics uses scp to copy in the opposite direction (from the…
Leahcim
  • 40,649
  • 59
  • 195
  • 334
249
votes
12 answers

rsync error: failed to set times on "/foo/bar": Operation not permitted

I'm getting a confusing error from rsync and the initial things I'm finding from web searches (as well as all the usual chmod'ing) are not solving it: rsync: failed to set times on "/foo/bar": Operation not permitted (1) rsync error: some files…
dreeves
  • 26,430
  • 45
  • 154
  • 229
219
votes
13 answers

How can I configure rsync to create target directory on remote server?

I would like to rsync from local computer to server. On a directory that does not exist, and I want rsync to create that directory on the server first. How can I do that?
ufk
  • 30,912
  • 70
  • 235
  • 386
192
votes
4 answers

Rsync copy directory contents but not directory itself

I'm trying to synchronize two contents of folders with different name: rsync -av ~/foo user@remote.com:/var/www/bar I'd like to copy the content of foo into bar at remote host, but not the directory foo itself. I've tried something like foo/*, but…
Tombart
  • 30,520
  • 16
  • 123
  • 136
189
votes
6 answers

rsync copy over only certain types of files using include option

I use the following bash script to copy only files of certain extension(in this case *.sh), however it still copies over all the files. what's wrong? from=$1 to=$2 rsync -zarv --include="*.sh" $from $to
user881480
  • 5,005
  • 6
  • 32
  • 31
171
votes
4 answers

keep rsync from removing unfinished source files

I have two machines, speed and mass. speed has a fast Internet connection and is running a crawler which downloads a lot of files to disk. mass has a lot of disk space. I want to move the files from speed to mass after they're done downloading.…
aaronsw
  • 4,455
  • 5
  • 31
  • 27
165
votes
7 answers

How to resume scp with partially copied files?

I'm using the scp shell command to copy huge folder of files. But at some point in time I had to kill the running command (by Ctrl+C or kill). To my understanding scp copies files sequentially, so there should be only one partially copied file. How…
Bohdan
  • 16,531
  • 16
  • 74
  • 68
163
votes
13 answers

rsync exclude according to .gitignore & .hgignore & svn:ignore like --filter=:C

Rsync includes a nifty option --cvs-exclude to “ignore files in the same way CVS does”, but CVS has been obsolete for years. Is there any way to make it also exclude files which would be ignored by modern version control systems (Git, Mercurial,…
Jesse Glick
  • 24,539
  • 10
  • 90
  • 112
158
votes
9 answers

What is the simplest way to remove a trailing slash from each parameter?

What is the simplest way to remove a trailing slash from each parameter in the '$@' array, so that rsync copies the directories by name? rsync -a --exclude='*~' "$@" "$dir" The title has been changed for clarification. To understand the comments…
sid_com
  • 24,137
  • 26
  • 96
  • 187
149
votes
3 answers

What does f+++++++++ mean in rsync logs?

I'm using rsync to make a backup of my server files, and I have two questions: In the middle of the process I need to stop and start rsync again. Will rsync start from the point where it stopped or it will restart from the beginning? In the log…
GodFather
  • 3,031
  • 4
  • 25
  • 36
148
votes
4 answers

rsync: difference between --size-only and --ignore-times

I'm trying to understand what the difference is between two options rsync --size-only and rsync --ignore-times It is my understanding that by default rsync will compare both the timestamps and the file sizes in order to decide whether or not a…
alfred_j_kwack
  • 1,665
  • 2
  • 11
  • 7
144
votes
15 answers

How to pass password automatically for rsync SSH command?

I need to do rsync by ssh and want to do it automatically without the need of passing password for ssh manually.
liysd
  • 4,413
  • 13
  • 35
  • 38
140
votes
6 answers

How do you use an identity file with rsync?

How do you use an identity file with rsync? This is the syntax I think I should be using with rsync to use an identity file to connect: rsync -avz -e 'ssh -p1234 -i ~/.ssh/1234-identity' \ "/local/dir/" remoteUser@22.33.44.55:"/remote/dir/" But…
cwd
  • 53,018
  • 53
  • 161
  • 198
1
2 3
99 100