Skip to content

Instantly share code, notes, and snippets.

@daviddoran
Created September 24, 2013 10:40
Show Gist options
  • Save daviddoran/6683035 to your computer and use it in GitHub Desktop.
Save daviddoran/6683035 to your computer and use it in GitHub Desktop.
Easily back up the content of a dokuwiki site to a git repository each hour. Only commits when there are changes.
#!/bin/sh
cd /var/www/dokuwiki/data && git add . && git add -u && git commit -a -m "Content update `date +'%H:%M %d/%m/%Y %Z'`" && git push origin master
# m h dom mon dow command
0 * * * * /path/to/backup-dokuwiki.sh >> /var/log/backup-dokuwiki.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment