Created
September 3, 2016 07:29
-
-
Save GitHub30/2a8e119be176a7660bf40e024d1e1d23 to your computer and use it in GitHub Desktop.
Backup script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Usage: | |
# bash backup.sh | |
# or | |
# chmod u+x backup.sh | |
# ./backup.sh | |
now=$(date +%Y%m%dT%H%M%S%Z) | |
filename=$now.tar.bz2 | |
cd | |
# Make backup directory if it does not exist. | |
mkdir -p backup | |
tar jcf backup/$filename --exclude ./backup . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment