Search code examples
backupremote-debuggingrsync

rsync remote to local automatic backup


I would like to auto backup my server monthly and weekly. My server is running Centos 5.5 and while searching the web I'm found a tool named rsync. I got my first update manually by using this command in terminal:

sudo rsync -chavzP --stats USERNAME@IPADDRES: PATH_TO_BACKUP LOCAL_PATH_TO_BACKUP

I then prompt my password for that user and bob's my uncle.

This backups the necessary files from my remote server to my local device but does somebody know how I can automate this? Like automatic running this script every sunday?

EDIT

I forgot to mention that I let direct admin backup the files I need and then copy those files from the remote server to a local server.


Solution

  • this command worked for me. Combine it with a cronjob

    rsync -avz username@ipaddress:/path/to/backup /path/to/save