Questions tagged [rsync]

rsync is a tool to efficiently copy directory hierarchies, locally or remotely, with powerful filters to decide what gets copied.

Selected questions

See also

If rsync doesn't seem to be able to do what you want, also look under .

2020 questions
397
votes
4 answers

Specify identity file (id_rsa) with rsync

I need to make periodic backups of a directory on a remote server which is a virtual machine hosted by a research organisation. They mandate that access to VMs is through ssh keys, which is all good, except that I can't figure out how to point rsync…
Jangari
  • 4,388
  • 2
  • 13
  • 9
313
votes
10 answers

Can rsync resume after being interrupted?

I used rsync to copy a large number of files, but my OS (Ubuntu) restarted unexpectedly: sudo rsync -azvv /home/path/folder1/ /home/path/folder2 After reboot, I ran rsync again, but from the output on the terminal, I found that rsync still copied…
Tim
  • 98,580
  • 191
  • 570
  • 977
255
votes
9 answers

scp without replacing existing files in the destination

How do I copy an entire directory into a directory of the same name without replacing the content in the destination directory? (instead, I would like to add to the contents of the destination folder)
biznez
241
votes
5 answers

How to rsync only new files

I am trying to set up rsync to synchronize my main web server to the remote server by adding newly generated file to the latter. Here is the command that I use: rsync -avh --update -e "ssh -i /path/to/thishost-rsync-key"…
supermario
  • 3,179
  • 5
  • 19
  • 14
205
votes
11 answers

Rsync filter: copying one pattern only

I am trying to create a directory that will house all and only my PDFs compiled from LaTeX. I like keeping each project in a separate folder, all housed in a big folder called LaTeX. So I tried running: rsync -avn *.pdf ~/LaTeX/ ~/Output/ which…
Seamus
  • 3,553
  • 7
  • 25
  • 25
158
votes
1 answer

Understanding the output of --info=progress2 from rsync

If I run rsync with --info=progress2, I get an output like 105.45M 13% 602.83kB/s 0:02:50 (xfr#495, ir-chk=1020/3825) But what do the single numbers mean? I haven't found a matching entry in the man page. The first number seems to be the…
muffel
  • 2,678
  • 4
  • 23
  • 21
137
votes
12 answers

How to rsync over ssh when directory names have spaces

I am trying to rsync from one server to another. The servers have the same directory structure but I am having trouble getting the remotes server to properly recognize the path name on the remote when there is a space in it. Here are the…
PyNEwbie
  • 1,549
  • 3
  • 11
  • 11
119
votes
4 answers

How to rsync a directory to a new directory with different name?

I'm doing a data transfer, the old file system relies deeply on a directory which now is on different path. This is a git directory which stores code online. I have no rights to move it or rename it. So what I can do is rsync this directory to the…
Zen
  • 7,287
  • 18
  • 50
  • 72
117
votes
7 answers

rsync compare directories?

Is it possible to compare two directories with rsync and only print the differences? There's a dry-run option, but when I increase verbosity to a certain level, every file compared is shown. ls -alR and diff is no option here, since there are…
chris
  • 1,635
  • 2
  • 16
  • 19
103
votes
7 answers

Does rsync verify files copied between two local drives?

I want to make a fresh new copy of a large number of files from one local drive to another. I've read that rsync does a checksum comparison of files when sending them to a remote machine over a network. Will rsync make the comparison when copying…
Frez
  • 1,133
  • 2
  • 8
  • 5
102
votes
8 answers

Using rsync to move (not copy) files between directories?

I have been using rsync to copy files for some time. My understanding is that rsync is faster than cp when some of the files to transfer are already in the destination directory, transferring only the incremental difference (i.e. the "deltas"). If…
Amelio Vazquez-Reina
  • 40,169
  • 77
  • 197
  • 294
101
votes
8 answers

rsync ignore owner, group, time, and perms

I want to know how use rsync for sync to folders recursive but I only need to update the new files or the updated files (only the content not the owner, group or timestamp) and I want to delete the files that not exist in the source.
alsanal
  • 1,113
  • 2
  • 8
  • 4
94
votes
3 answers

How to rsync multiple source folders

I want to rsync multiple sources and I wonder the best way to achieve that. e.g. /etc/fstab /home/user/download I thought about 3 solutions : Solution 1 multiple call to rsync rsync -a /etc/fstab bkp rsync -a /home/user/download bkp con : harder…
user1437346
  • 1,071
  • 1
  • 8
  • 5
94
votes
14 answers

How to rsync files between two remotes?

I would like to transfer files between two remote hosts using on local shell, but it seems rsync doesn't support synchronisation if two remotes are specified as follow: $ rsync -vuar host1:/var/www host2:/var/www The source and destination cannot…
kenorb
  • 20,250
  • 14
  • 140
  • 164
90
votes
7 answers

How to avoid password prompt with rsync (and without using public keys)?

I need to execute rsync, without it prompting me for password. I've seen in rsync manpage that it doesn't allow specifying the password as command line argument. But I noticed that it allows specifying the password via the variable…
Dor
  • 2,445
  • 7
  • 33
  • 32
1
2 3
99 100