Added the ability to change backup location and compression
This commit is contained in:
parent
ec443ce192
commit
a61cebe7c6
20
backup
20
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"
|
||||
|
Loading…
Reference in New Issue
Block a user