0

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.

Thanks

1
  • 1
    Have you even tried googling "rsync tutorial"?
    – darioo
    Dec 22, 2010 at 14:51

2 Answers 2

2

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
1
  • Maybe also look into the -a option, as per OP's needs.
    – Victor
    Dec 22, 2010 at 14:55
0

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: http://www.sysresccd.org/Sysresccd-manual-en_Backup_and_transfer_your_data_using_rsync

If you want to create automatic tasks like backups, read about cron jobs: http://adminschoice.com/crontab-quick-reference

There are another network backup solutions like Bacula.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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