Skip to content

Instantly share code, notes, and snippets.

@samnazarko
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samnazarko/2d2b93e8150b5ff694d9 to your computer and use it in GitHub Desktop.
Save samnazarko/2d2b93e8150b5ff694d9 to your computer and use it in GitHub Desktop.
Sets up Apache2 to serve webCDN on a Debian or Ubuntu system.
#!/bin/bash
apt-get update
apt-get -y install rsync apache2
echo "rsync -auP --delete rsync://rsync.samnazarko.co.uk/cdn /var/www" > /root/sync.sh
chmod +x /root/sync.sh
echo "0 * * * * /root/sync.sh
" > /var/spool/cron/crontabs/root
echo Performing initial sync
/root/sync.sh
@samnazarko
Copy link
Author

Added a new line to the crontab as cronjobs should end with an empty line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment