Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm looking to back up some large directories on a Dedicated Server to another Server on a daily basis using minimal bandwidth

RSync looks like its up to the task but I'm unsure of the best command switches

I would like to do multiple selected directories to one "backup" directory on another machine over SSH

Any ideas?

share|improve this question
add comment

4 Answers

I'd like to add that you'd better user --numeric-ids flag to preserve uids/gids of your files so they would not be re-mapped to local users.

If you're going to keep historical backups (say, YYYY-MM-DD daliy directories), option --link-dest=DIR would be of great use.

In case your data can be effectively compressed (source code, plaintext files, logs) it -z can be quite handy.

Otherwise, -aH would cover most of your needs.

share|improve this answer
add comment

Try doing this (from backup server ):

rsync \
    -a \
    --bwlimit=100 \
    remote-server:"/path1 /path2 /path3" /local/backup_$(date +%Y%m%d_%H:%M)

--bwlimit=100 stands for al most 100KB/sec

You can use hard links with cp -al between days, that way you can save a lot of disk space and rsync only changed files !

That's how rsnapshot project works.

share|improve this answer
    
Would this be suitable for a cron job, can this be automated? –  mobile Feb 19 '13 at 16:00
    
Remember that -a preserves only a subset of the metadata associated with files. For system backup, that's generally not enough. –  Stephane Chazelas Nov 22 '13 at 15:48
add comment

rsync is ok, but remember you need to be running rsyncd on one of the machines to take advantage of rsync's change-detection algorithm.

As for the hardlinking sputnick mentions, you might also be interested in fdupes.

share|improve this answer
add comment

Rsync is indeed the right low-level tool to handle this. Rather than worry about rsync options, use a dedicated backup tools, there are plenty. Rsnapshot is a popular choice, see if your requirements (which you aren't very explicit about) meet its capabilities. Duplicity is another backup tool based on the rsync library.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.