Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a server (Linux) with NAS which is mounted as folder "mount" I have website in "public_html" folder.

I want to take backup of website in mount folder automatically at certain intervals for e.g. every hour. I read that there is something called "rsync" which is used to make two folders sync. And it doesn't copy all files every time and instead matches if the file has been changed and then only update changed files. How do I use it to make automatic backups? I have root access to server.


share|improve this question

migrated from Dec 22 '10 at 15:50

This question came from our site for professional and enthusiast programmers.

Have you even tried googling "rsync tutorial"? – darioo Dec 22 '10 at 14:51

Setup a cron that looks like this:

0 * * * * rsync -rltv [source] [destination]

This says, every hour sync the source directory to the destination directory (only sending changed files)

The flags mean:

  • r - recursive
  • l - copy symlinks as symlinks
  • t - preserve modification times
  • v - increase verbosity
share|improve this answer
Maybe also look into the -a option, as per OP's needs. – Victor Dec 22 '10 at 14:55

I think it's better for you to have some knowledge about rsync and crons. Then, you can plan how you are going to deploy your backup solution.

First of all take a look a detailed explanation about rsync:

If you want to create automatic tasks like backups, read about cron jobs:

There are another network backup solutions like Bacula.

share|improve this answer

Your Answer


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.