Add date and hostname to backup file. Delete previous dates.
This commit is contained in:
@@ -9,7 +9,9 @@ source $DIR/../source.env
|
||||
|
||||
## Variables ##
|
||||
|
||||
file="/tmp/Backup-Docker.zip"
|
||||
DATE="`date "+%Y%m%d"`"
|
||||
BASENAME="/tmp/Backup-Docker"
|
||||
file="$BASENAME.$DATE.$HOSTNAME.zip"
|
||||
time="`which time`"
|
||||
|
||||
## Main ##
|
||||
@@ -17,7 +19,7 @@ time="`which time`"
|
||||
# Remove the last backup.
|
||||
if [[ -e $file ]]; then
|
||||
echo "`date` - Removing existing file."
|
||||
rm -fv $file
|
||||
rm -fv "$BASENAME"*
|
||||
fi
|
||||
|
||||
echo -e "\n`date` - Take down services for a cold backup."
|
||||
|
Reference in New Issue
Block a user