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

5
votes
2answers
543 views

Sync files from a mac to a flash drive - automatically?

I have a flash drive, let's name it FLASH. I want, when on my mac, when FLASH is plugged (and automatically mounted), execute a specific script and make ~/Documents to be automatically copied to ...
5
votes
1answer
3k views

Rsync — Itemized List of Changes

I've learned that with the -i option, I can get rsync to list all the changes it makes. I've been using it along with the -n or --dry-run options so that I can always learn about all expected changes ...
5
votes
1answer
192 views

How can I synchronize all PDFs from one directory with Dropbox?

I want to synchronize all the PDFs from one directory (my Zotero library) to Dropbox. Finally, I want to have a list of all the PDFs, not the directory names. I successfully synchronized all my PDFs ...
5
votes
1answer
333 views

How to merge multiple WebDAV accounts for backup?

I use davfs, aufs, rsync: sudo mount -t davfs -o uid=wd,gid=wd,dir_mode=777,rw https://wd1.wd.wd/ /mnt/webdav1 sudo mount -t davfs -o uid=wd,gid=wd,dir_mode=777,rw https://wd1.wd.wd/ /mnt/webdav2 ...
5
votes
2answers
8k 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 ...
5
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 ...
4
votes
2answers
3k views

How can I send single file to multiple remote sites at the same time?

Can scp be used to send a single file to multiple remote servers at the same time? If so, how? If not, what's the alternative?
4
votes
1answer
5k views

RSync - Excluding a particular subdirectory and its children where the subdirectory exists at different levels

G'Day, I am using rsync to recursively sync a remote folder tree that looks something like the following: /folderA/a1/cache /folderA/a1/cache/A1 /folderA/a1/cache/A2 /folderA/a1/somefolder ...
4
votes
2answers
4k views

rsync is very slow (factor 8 to 10) compared to cp on copying files from nfs-share to local dir

I have a freshly installed ubuntu-server which is ought to be the new backup-server for our VM-storage. The server has 4 nics, 2 of them 10Gbit (in fact an intel x540-T2 with the newest driver ...
4
votes
2answers
816 views

How to use rsync with a remote remote host

I am a happy user of rsync -e ssh and use it to synchronize data between my machine and a remote host using rsync -avz -e ssh me@hostA:~/folder ~/folder And this did what I needed until now. I am ...
4
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 ...
4
votes
2answers
166 views

Is there a way to put comments in an rsync --files-from file?

I have a file that rsync uses as --files-from: dir1 dir2 dir3 I want to be able to put comments above each dir entry like that: # my dir1 comment dir1 #dir2 comment dir2 #yet another comment ...
4
votes
3answers
1k views

Performing accurate snapshot and incremental backups to a remote server

I have a few Ubuntu (and potentially RHEL) servers I'd like to back up to a central backup server (via rsh/SSH). I'd like to do both snapshot and incremental backups. The goal is that if one of the ...
4
votes
3answers
756 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 ...
4
votes
3answers
348 views

Help Shell script to pass variables to rsync

I'm trying to create a simple wrapper shell script for rsync. When I send file names to my script, rsync can never seem to identify the correct location. The file names have spaces in them. I've tried ...
4
votes
1answer
9k 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 ...
4
votes
2answers
2k views

rsync mkstemp failed Invalid argument (22) with davfs mount of Box.com cloud

I mounted Box.com cloud storage using davfs according to these instructions. I mounted my Box.com account under /home/me/Cloud/Box I can access the mounted filesystem via Dolphin as well as via the ...
4
votes
3answers
461 views

Monitor directory and if a file is requested then rsync on demand

Is there a tool that monitors a certain directory and if a program tries to access a file in that directory, the program loads that file from another place transparent for any application that tries ...
4
votes
4answers
4k views

How to exclude numeric directories with rsync?

I know rsync has an --exclude option which I use quite frequently. But how can I specify that it should exclude all "numeric" directories? In the directory listing below I would like to only have it ...
4
votes
1answer
1k views

Do any Linux distributions have a folder sync option (like briefcase in windows)?

I want to keep my local folder synchronized with a network folder. Is there any folder synchronization utility or feature in Linux?
4
votes
2answers
404 views

How to synchronize a networked drive and an external drive (Ubuntu & OS X)?

In light of a recent hardware failure, I've decided that it's time to be a little less lax regarding back-ups. What I have: An Ubuntu 10.10 'server/NAS' A MacBook 5,2 A WD external HDD The server ...
4
votes
1answer
437 views

Only use mtime comparison with rsync?

Is it possible to sync files via rsync and let rsync only compare mtime informations? Or is there another tool for this job? That means that such a tool only copies src to destination if the src is ...
4
votes
2answers
2k views

rsync-like tool that supports compression and maintains hardlinks?

I use an rsync-based backup scheme to maintain daily (and soon weekly and monthly as well) "snapshots" of my file server, using rsync's link-dest feature to store hardlinks between the snapshots for ...
4
votes
1answer
51 views

Use rsync to just get a folder and its content with a pattern

I've looked all around the internet, looked in regexp sites and everything else, but I'm unable to write a rsync command to fetch what I want to. I need to mirror the FreeBSD release, but I don't ...
4
votes
1answer
70 views

“hard-linking” parts of a big file in which only a small part has changed

I use rsync to make backups: rsync -a --link-dest=PATHTO/$PREVIOUSBACKUP $SOURCE $CURRENTBACKUP This way I save space due to using hard links. The problem appears when I need to backup a huge file ...
4
votes
2answers
304 views

Two-way rsync results in oscillating content

I am trying to sync content between two servers. The servers are identical builds (Ubuntu 12.04LTS) and have this cron job running to sync the content: rsync -arzc --update --delete ...
4
votes
2answers
845 views

Restrict file access to append only

I have a directory with log files and I'm putting logs from script launched by users into them. Logging with syslog doesn't seem possible in this case. (non-daemon rsync) I want the users to have ...
4
votes
2answers
526 views

How to rsync a chroot without breaking symlinks?

I'd like to rsync (backup) a chroot environment from outside the chroot. For that I first make a lvm snapshot of the chroot volume and then run rsync on that. The only problem with this approach: ...
4
votes
2answers
18k views

Why do I get an “rsync: failed to set times on … : Operation not permitted (1)” error on Ubuntu 10.10 with SME Server 7.4? [duplicate]

I am trying to cron an rsync via ssh between two fileservers that are running SME Server 7.4 and Ubuntu 10.10, respectively. The first rsync worked just fine (for reasons that I do not know), but now, ...
4
votes
1answer
39 views

Different rsync behavior for identical directory name

I want to synchronize 2 codebases. The below command is working great, except that it doesn't account for one use case that I have with 2 directories named test in different locations: /test/ ...
4
votes
1answer
712 views

Using setfacl to create recursive permissions for Apache with rsync

I have a Dokuwiki installation locally, which I regularly sync to my server with rsync. I'm also going to give a friend of mine an ssh account, and host his public Dokuwiki installation. However, I'm ...
4
votes
1answer
5k views

Move files and delete directories with rsync?

Recently I needed to delete a large number of files (over 1 million) and I read that doing: rsync -av --delete `mktemp -d`/ ~/source && rmdir ~/source Was one of the most optimized ways to ...
4
votes
2answers
294 views

light weight disk based backup solution

Currently I am using Dirvish to backup a handful remote machines, both Linux and Windows to local disks. But Dirvish hasn't seen any updates for many years and it has a couple of small annoyances ...
3
votes
3answers
437 views

Is setting a higher nice level for a process an effective way to reduce its impact on system load/CPU time?

I have an rsync cron job which is pushing the server load and triggering monitor alerts. If I set the job to be run with a high nice level, would that effectively reduce the impact it has on system ...
3
votes
3answers
3k views

How do I backup via rsync to a remote machine, preserving permissions and ownership?

Drive A is 2TB in a closet at home. Drive B is 2TB in my office at work. I'd like drive A to be the one I use regularly and to have rsync mirror A to B nightly/weekly. The problem I have with this ...
3
votes
4answers
148 views

Comments in argument lists?

Some commands, such as rsync, take in lists as an argument. Can these files contain unix comments like #?
3
votes
2answers
895 views

Rsync two file types in one command?

How to write those into one line, also without repeat the same path? rsync -a root@somewhere:/folder/remote/*.txt . rsync -a root@somewhere:/folder/remote/*.jpg .
3
votes
2answers
1k views

creating a device image for a network location

I have a dedicated ubuntu server with hetzner.de. hetzner also provides a seperate backup space accessible via samba/ftp/sftp/scp. In their support document about backups, the following line is ...
3
votes
3answers
234 views

How to rsync over ssh when directory names have spaces

I am new to Linux and 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 ...
3
votes
2answers
2k 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='*/' ...
3
votes
3answers
466 views

Rsync problem with cron and no problem manually

I have a backup.sh file that launch an rsync command. This rsync is to backup my dedicated server on a RaspberryPi running raspbian. (I use keychain so I don't need to type any password etc ...) The ...
3
votes
3answers
437 views

Backup and synchronization

I want to synchronize my personal document repository between my different computers in my home. Today this folder is under a dedicated partition of the hard drive of a dual boot workstation. My ...
3
votes
1answer
188 views

How do I backup a non-empty directory and preserve metadata like permissions/user-group ownership/time file was modified?

I used rsync for creating a backup copy: bash-3.2$ rsync -tvrog /export/home/kent/Scripts /export/home/kent/TEST_Scripts_rsync With these options: Options: -v, --verbose ...
3
votes
1answer
3k views

Having an rsync job complete after closing SSH connection

I am transferring a large amount of files from one computer to another using rsync. I am doing this by SSHing into the source computer and executing a command like this: sudo rsync ssh ...
3
votes
1answer
3k views

How should I rsync files in /var/www if I want them to be owned by www-data?

I have set up a new ec2 ubuntu box and installed apache and php5. By default you log onto the box with the ubuntu user who has sudo privileges. I believe apache runs as root and php5 runs as ...
3
votes
1answer
5k views

Real Time Local File Sync

How can I set up an instant file sync for two local directories? The catch is I need it in real time (15, 10 or even 5 seconds is too slow), and I don't want the target root directory created. For ...
3
votes
2answers
106 views

Rsync won't Give Up Writing to an Unmounted Remote Drive

I've been having issues with a external hard drive staying mounted to a mount point. That's not the topic of this question, but background info. The issue is with rsync. It doesn't seem to recognize ...
3
votes
1answer
228 views

Best way to sync files - copy only EXISTING files and only if NEWER than target

I'm doing this sync locally on Ubuntu 12.04. The files are generally small text files (code). I want to copy (preserving mtime stamp) from source directory to target but I only want to copy if the ...
3
votes
1answer
97 views

rsync move files, leave directories?

I'm using rsync to copy data between my internal and external hard drives. It's done what I need, but I'm running out of room on my internal hard drive. So, is there any way to get rsync to function ...
3
votes
5answers
655 views

How can a filesystem be copied exactly as is?

I have a file system for a device I am programming that I would like to make an exact copy of. Ideally I would like this copy to be identical to the folder that it was copied from. I have tried using ...