Skip to content

Instantly share code, notes, and snippets.

@rmrf-run
Last active December 9, 2015 15:59
Show Gist options
  • Save rmrf-run/4b4fee763d14d64b1b7a to your computer and use it in GitHub Desktop.
Save rmrf-run/4b4fee763d14d64b1b7a to your computer and use it in GitHub Desktop.
### Place in your /etc/cron.d/ directory
### Assumes your git folder is at /root/backup
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
HOME=/root/
* 2 * * * root cd /root/backup && iptables-save > /root/backup/iptables && git add . && git commit -m "Daily Backup" && git push >> /root/backup/log 2>&1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment