Wednesday, January 26, 2011

Are there any scripts to synchronize sites?

I've just set up a fail-over DNS to switch the site to a second host if the first is down. This is great for showing an old / archived version of the site, but I suspect maintenance is going to be a real pain.

I moved the files over with rsync in the first place. Is this the kinda thing that could be run as a cron job, automatically moving over newer files?

  • Rsync was designed exactly for this sort of thing. It will work great as a cron job.

    To do a daily sync on the cron job:

    $ crontab -e
    Add line:
    0 0 * * * [rsync command line]
    
    John Gardeniers : Google "man crontab" for full details.

0 comments:

Post a Comment