added date stamp
This commit is contained in:
parent
36921a5079
commit
d7ce42204a
8
backup
8
backup
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
BACKUP_LOCATION="/nas/share/backup.tar"
|
BACKUP_LOCATION="/nas/share/backup-$(date +%Y-%m-%d).tar"
|
||||||
COMPRESS=false
|
COMPRESS=false
|
||||||
|
|
||||||
rm -f $BACKUP_LOCATION
|
rm -f $BACKUP_LOCATION
|
||||||
@ -28,7 +28,7 @@ tar -pcvf $BACKUP_LOCATION ./*.bak
|
|||||||
|
|
||||||
while read folder; do
|
while read folder; do
|
||||||
# list the contents of each folder
|
# list the contents of each folder
|
||||||
echo -e "\e[32mbackingup: $folder"
|
echo -e "\e[32mBacking Up: $folder"
|
||||||
tar -rfp $BACKUP_LOCATION $folder &>/dev/null
|
tar -rfp $BACKUP_LOCATION $folder &>/dev/null
|
||||||
done < *.bak
|
done < *.bak
|
||||||
|
|
||||||
@ -38,9 +38,9 @@ echo ""
|
|||||||
|
|
||||||
if [ "$COMPRESS" = true ];
|
if [ "$COMPRESS" = true ];
|
||||||
then
|
then
|
||||||
echo -e "\e[0mCompressing backup"
|
echo -e "\e[0mCompressing Backup"
|
||||||
gzip $BACKUP_LOCATION
|
gzip $BACKUP_LOCATION
|
||||||
echo -e "\e[0mRemoving Uncompressed backup"
|
echo -e "\e[0mRemoving Uncompressed Backup"
|
||||||
rm -f $BACKUP_LOCATION
|
rm -f $BACKUP_LOCATION
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user