Skip to content

Instantly share code, notes, and snippets.

@drewgates
Created March 23, 2016 10:41
Show Gist options
  • Save drewgates/50cb5bcbe2c84de2ef76 to your computer and use it in GitHub Desktop.
Save drewgates/50cb5bcbe2c84de2ef76 to your computer and use it in GitHub Desktop.
very simple backup script
#!/bin/bash
# Very Simple Backup Script.
# Place this script in your project folder, and use chmod +x to make it executable.
# Either run manual backups periodically with ./savechanges.sh or set up a cron job to automate.
# Enjoy!
NOW=$(date +%Y%b%d-%H_%M)
echo "backing up"
date
tar -zcf ~/streamwhus-changes-$NOW.tar.gz ./*
echo "archive size:"
du -hs ~/site-changes-$NOW.tar.gz | cut -f1
echo "backup completed."
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment