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

learn more… | top users | synonyms

29
votes
7answers
29k views

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 ...
28
votes
5answers
26k views

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) ...
24
votes
1answer
17k views

Delete extraneous files from dest dir via rsync?

Say I have SRC 001.jpg 002.jpg 001.txt a.zip DEST hello.jpg rsync -d --delete SRC:{*.jpg,*.txt} DEST It doesn't remove hello.jpg from DEST, any idea how to archive this?
22
votes
3answers
13k views

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 ...
20
votes
5answers
6k views

What is the need for rsync server in daemon mode

I don't understand the need for an rsync server in daemon mode. What are the benefits from it if I can use rsync with SSH or telnet?
18
votes
3answers
20k views

How can I pause/resume rsync

How can I pause an rsync that's running? First time I did Ctrl+C to kill it and used the -P flag to run again. Is this prone to corrupt the current file transfer? Second time I simply put MacOS to ...
18
votes
4answers
9k views

Resume transfer of a single file by rsync

In Ubuntu, I want to copy a big file from my hard drive to a removable drive by rsync. For some other reason, the operation cannot complete in a single run. So I am trying to figure out how to use ...
16
votes
4answers
16k views

Is there ever a reason to use scp instead of rsync?

Is there a reason to use scp instead of rsync? I can see no reason for using scp ever again, rsync does everything that scp does, with more safety (can preserve symlinks etc).
15
votes
5answers
11k views

view stdout for another pts

Here is the situation. I left my pc at home doing an rsync from a 2TB hard drive to another 2TB hard drive (it's going to take a while since they are both USB 2.0). I am now at work and I have ssh-ed ...
14
votes
4answers
994 views

Why not always use rsync?

I wanted to ask is there any reason not to use rsync for everything and abandon cp? I wasn't aware of rsync and now I don't know why cp is ever needed.
14
votes
5answers
11k views

rsync all files of remote machine over SSH without root user?

I have this command to backup a remote machine. The problem is that I need root rights to read and copy all files. I have no root user enabled for security reasons and use sudo the Ubuntu way. Would I ...
14
votes
3answers
18k views

How to rsync only new files

I am trying to set up rsync to syncronize my main web server to the remote server by adding newly generated file to the later. Here is the command that I use: rsync -avh --update -e "ssh -i ...
13
votes
1answer
440 views

What happens when you rsync without a destination?

To make the story short, I did an rsync: rsync -avP root@exampleserver.com:/tmp/ And I forgot to put in my source directory... :( I really meant to run: rsync -avP /tmp/ ...
11
votes
6answers
11k views

tar + rsync + untar. Any speed benefit over just rsync?

I often find myself sending folders with 10K - 100K of files to a remote machine (within the same network on-campus). I was just wondering if there are reasons to believe that, tar + rsync + ...
11
votes
3answers
15k views

Sync a local directory with a remote directory in Linux

I have a folder with a few files in it, and some space on a web server. I want to do a bi-directional sync between the local folder and the remote one in linux, just on modification time. How do I ...
11
votes
1answer
3k views

Making a progressbar with “dialog” from rsync output

I'm looking for a way to filter/redirect rsync output in a manner where it can be fed to the "dialog --gauge" command, so I can get a nice looking progressbar during file sync. Currently I have only ...
10
votes
5answers
14k views

Syncing directories in both directions with rsync

I happen to know about rsyn, and I use rsync to sync between my mac and a linux server as follows. rsync -r -t -v MAC LINUX rsync -r -t -v LINUX MAC I expected to run the first command to sync, but ...
10
votes
1answer
2k views

rsync: how to exclude the topmost directory

So, I have a seemingly simple issue, but so far I haven't found a solution: I want to exclude the topmost directory from an rsync, while still syncing all its children. The particular issue is that I ...
9
votes
2answers
13k views

“rsync: failed to set permissions on …” error with rsync -a or -p option

When I use the -a option as is asked and answered in Preserve the permissions with rsync, I got a lot of "rsync: failed to set permissions on" errors. rsync: failed to set permissions on ...
9
votes
5answers
503 views

Directory sync with automatic peer discovery

I'm working with a cluster of Linux servers sitting behind the Amazon cloud autoscaling feature (documentation). There are files that accumulate on each server, they are cache files for the ...
8
votes
1answer
2k views

Reusing ssh session for repeated rsync commands [duplicate]

Possible Duplicate: Using an already established SSH channel I have a remote server accessible via a chain of SSH proxies. The resulting channel is wide and fast enough, but setting it up ...
8
votes
3answers
3k views

Why does rsync fail to copy files from /sys in Linux?

I have a bash script which uses rsync to backup files in Archlinux. I noticed that rsync failed to copy a file from /sys, while cp worked just fine: # rsync /sys/class/net/enp3s1/address /tmp ...
8
votes
2answers
7k views

rsync “skipping non-regular file” when cloning my Aperture library

I am trying to use rsync to maintain a backup copy of my Aperture library. When I run the sync command to see what would happen this is the outcome: rsync --dry-run -r "/Volumes/Data/Aperture ...
8
votes
2answers
2k views

Why does my rsync not allow block-size>128K?

Running rsync with a large* --block-size like this: rsync -avvz --rsh 'ssh -c arcfour' --block-size 1048576 --inplace --progress example.com:/big.file /big.file I get the following error: Invalid ...
8
votes
1answer
2k views

Is using rsync while source is being updated safe?

Is it safe to use rsync when the source filesystem is mounted and writeable, assuming that it may very well be modified while rsync is running? I presume that under race conditions I may not get the ...
8
votes
2answers
12k views

Asking rsync to delete files on the receiving side that don't exist on the sending side, with exceptions on the receiving side

I have read these threads: rsync --delete --files-from=list / dest/ does not delete unwanted files Delete extraneous files from dest dir via rsync? But, as far as I can tell (maybe I am missing ...
8
votes
3answers
3k views

How do you compare two folders and copy the difference to a third folder?

You've got three folders: folder current, which contains your current files folder old, which contains an older version of the same files folder difference, which is just an empty folder How do ...
8
votes
3answers
616 views

rsync most recent x GB

I'm looking for a command/script to allow the most recently modified files (up to) 10GB be copied to another computer. So if there are 4 files 4 GB each, only 2 of them should be transferred by the ...
8
votes
2answers
971 views

What keeps one side of an rsync so busy?

I've got a Debian machine on my LAN serving as a backup server for the others. It has four HDDs combined into a software RAID 5 md device, on that an LVM, and on that btrfs. Backups are made using ...
7
votes
3answers
14k views

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 ...
7
votes
4answers
5k views

cp or rsync, is cp really worth it?

I hope this does not count as a question without a real answer, as I can't seem to find a good reason to use cp(1) over rsync(1) in virtually all circumstances. Should one typically favour rsync over ...
7
votes
1answer
3k views

How to include files that are excluded in an rsync

I'm trying to set up an rsync that excludes all .* files except for .htaccess but unfortunately, this doesn't work: rsync -avP --exclude=".*" --include="./.htaccess" ./. user@server:/dir Is it ...
7
votes
2answers
1k views

sync files recursively between two folders where files are less than 24 hours old

I want to find all the files under a directory which are within 24 hours then rsync those files with another server. There are some old files that I do not want to transfer, however if those old ...
7
votes
3answers
968 views

How can I exclude files by default with rsync?

How can I exclude files by default with rsync? Here is how my normal rsync syntax starts out: rsync --exclude ".ht*" --exclude "error_log" --exclude ".DS*" --exclude "old" ... I've seen a lot of ...
7
votes
2answers
6k views

rsync not using --files-from option?

I'm trying to run rsync -a --files-from=~/.rsync_file_list ~/destination and it tells me: rsync error: syntax or usage error (code 1) at options.c(1652) [client=3.0.7]. Can anyone enlighten me as to ...
7
votes
3answers
6k views

Give user permissions to all files and folders

I want to have a user who has access to all the files and folders on the system. This is for the purpose of using RSYNC on a local machine to backup a remote machine. At the moment we are using the ...
7
votes
5answers
2k views

force copying a corrupted home directory

I have a home directory in a disk that has a lot of corrupted files. I am trying to save most files as possible. I am trying to create a backup of my home directory on an external drive using tar ...
7
votes
1answer
719 views

rsync: skip files for which I don't have permissions

I'm using rsync -rlptD to copy a directory from another user. There are a few files (I have no way of knowing these in advance) which I don't have permission to copy. Is there a way have rsync ignore ...
6
votes
3answers
1k views

Transfering millions of files from one server to another

I have two servers. One of them has 15 million text files (about 40 GB). I am trying to transfer them to another server. I considered zipping them and transferring the archive. But I realized that ...
6
votes
2answers
6k views

Rsync except .svn folders and their sub-contents?

Dealing with a subversion repo and a new user that didn't quite understand how it worked. Long story short, since their local structure was messed up due to copying random .svn folders about, I did ...
6
votes
3answers
8k views

Can rsync resume after being interrupted?

I used rsync to copy a large number of files, but my OS (Ubuntu) restarted unexpectedly. After reboot, I ran rsync again, but from the output on the terminal, I found that rsync still copied those ...
6
votes
2answers
4k views

How to use rsync to backup a directory without git subdirectory

I want to copy my c directory with all subdirectories excluding ./git subdirectory. I do it using rsync : echo "copy c and sh files " rsync -a --include='*.c' --include='*.sh' --include='*/' ...
6
votes
1answer
14k views

Preserve the permissions with rsync

Let's say I have a file a.txt in LINUX with permission of 0664. When I use rsync to copy the file to my Mac with rsync -r -t -v LINUX MAC, the file's permission becomes 0644. How can I keep the ...
6
votes
2answers
3k views

How do I save changed files?

I have two folders: ORIGINAL/ ORIGINAL_AND_MY_CHANGES/ My friend has a copy of ORIGINAL/. I would like to generate MY_CHANGES.tgz -- it should contain only new/changed files from ...
6
votes
2answers
4k views

root user denied access to .gvfs in rsnapshot?

I was running rsnapshot as root and I got the following error. Why would this happen? what is .gvfs? rsnapshot weekly slave-iv ...
6
votes
2answers
937 views

How can I speed up operations on sparse files with tar, gzip, rsync?

I have a sparse file. (du -h reports 3G and du -h --apparent-size reports 100G.) So far, so good. Now, when I want to compress the file using tar or send it over the network using rsync, it will ...
6
votes
4answers
6k views

rsync, delete files on receiving side that were deleted on sending side. (But don't delete everything)

I'd like to use rsync to... delete files on the receiving side that were also deleted on the sending side not delete other files that are in the rsynced directory on the receiving side For ...
6
votes
2answers
245 views

Rsync different behavior when syncing folders HDD-HDD or HDD-Ext HD

When I sync two folders between two HDDs, rsync only lists the changes made at the end. However if I sync a folder between a HDD and an external HD, while the sync is running it is listing each ...
6
votes
2answers
10k views

rsync gives “chown <…> failed: Invalid argument (22)” with nfs share

I'm trying to back up my entire system to an external disk using rsync, via a shell script which is run as root: #!/bin/bash rsync -vSHPhhaX --numeric-ids --delete ...
6
votes
1answer
6k views

Copy symlink AND where it points to using rsync

It doesn't need to be done by rsync, but it would be nice not have to write a script to do this, and rsync is very close to what I want. "rsync -a" (or -l) can preserve symlinks, and -L can ...