Created
August 22, 2016 14:22
-
-
Save jfm-so/f3c77c12756932a176bddffc1d7903d0 to your computer and use it in GitHub Desktop.
Web folder backup
This file contains 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
####FitTech Backup Script | |
#### Johnathan Martin (2016) | |
## | |
set -e #Exit on Errors | |
## | |
BACKUPFROM='/var/www/' #Directory to Backup | |
BACKUPTO='/media/HDD1/' #Location of backup | |
TIMESTAMP=$(date +%s); #Unix Timestamp | |
## | |
tar -zchf $BACKUPTO$TIMESTAMP.tar.gz $BACKUPFROM #Create TAR File | |
#-z compress | |
#-c create | |
#-v verbose ##NOT IN USE CURRENTLY | |
#-h ignore symlinks | |
#-f specify filename | |
## | |
echo "Last Backup Completed: $TIMESTAMP" >> $BACKUPFROM.lastbackup # Log last backuptime | |
## |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment