Skip to content

Instantly share code, notes, and snippets.

@wimleers
Created October 31, 2010 23:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wimleers/657343 to your computer and use it in GitHub Desktop.
Save wimleers/657343 to your computer and use it in GitHub Desktop.
Script that syncs a directory recursively to a Push CDN using rsync.
#!/bin/sh
LOGFILE=/data/logs/dps-cdn-rsync/$(date "+%Y-%m").log
# Append a header first, so we know when this script was run.
date "+%n%n=====%nSyncing DriverPacks to CDN at %Y-%m-%d %H:%M:%S" >> $LOGFILE
# Now perform the actual syncing, still appending to the logfile.
rsync -avv --progress --delete --exclude lost+found --exclude .ssh --exclude .bash_history /data/www/downloadsorigin.driverpacks.net/ dpsdl.drupalcdn@storage01.netdna.com:/home/dpsdl.drupalcdn/public_html/ >> $LOGFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment