added date stamp

This commit is contained in:
tofasthacker 2024-02-19 16:58:10 -05:00
parent 36921a5079
commit d7ce42204a

8
backup
View File

@ -1,6 +1,6 @@
#!/bin/bash
BACKUP_LOCATION="/nas/share/backup.tar"
BACKUP_LOCATION="/nas/share/backup-$(date +%Y-%m-%d).tar"
COMPRESS=false
rm -f $BACKUP_LOCATION
@ -28,7 +28,7 @@ tar -pcvf $BACKUP_LOCATION ./*.bak
while read folder; do
# list the contents of each folder
echo -e "\e[32mbackingup: $folder"
echo -e "\e[32mBacking Up: $folder"
tar -rfp $BACKUP_LOCATION $folder &>/dev/null
done < *.bak
@ -38,9 +38,9 @@ echo ""
if [ "$COMPRESS" = true ];
then
echo -e "\e[0mCompressing backup"
echo -e "\e[0mCompressing Backup"
gzip $BACKUP_LOCATION
echo -e "\e[0mRemoving Uncompressed backup"
echo -e "\e[0mRemoving Uncompressed Backup"
rm -f $BACKUP_LOCATION
fi