Skip to content

Instantly share code, notes, and snippets.

@jfm-so
Created August 22, 2016 14:22
Show Gist options
  • Save jfm-so/f3c77c12756932a176bddffc1d7903d0 to your computer and use it in GitHub Desktop.
Save jfm-so/f3c77c12756932a176bddffc1d7903d0 to your computer and use it in GitHub Desktop.
Web folder backup
####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