diff --git a/backup b/backup index 22eda7a..a6b214f 100755 --- a/backup +++ b/backup @@ -1,5 +1,9 @@ #!/bin/bash +BACKUP_LOCATION="/nas/share/backup.tar" + + + echo ' ________ ________ ________ ___ __ ___ ___ ________ _________ ________ ________ ___ |\ __ \|\ __ \|\ ____\|\ \|\ \ |\ \|\ \|\ __ \ |\___ ___\\ __ \|\ __ \|\ \ @@ -19,17 +23,25 @@ echo "" echo -e "\e[0mStarting Backup" -tar -cvf /nas/share/backup.tar ./*.bak +tar -cvf $BACKUP_LOCATION ./*.bak while read folder; do # list the contents of each folder echo -e "\e[32mbackingup: $folder" - tar -rf /nas/share/backup.tar $folder &>/dev/null + tar -rf $BACKUP_LOCATION $folder &>/dev/null done < *.bak echo "" -#echo -e "\e[0mCompressing backup" -#gzip /nas/share/backup.tar + + +if [ "$COMPRESS" = true ]; +then + echo -e "\e[0mCompressing backup" + gzip $BACKUP_LOCATION + echo -e "\e[0mRemoving Uncompressed backup" + rm -f $BACKUP_LOCATION +fi + echo -e "\e[0mBackup Done"