fixed checking if the backup folder is empty

This commit is contained in:
kolaente 2018-01-30 22:19:23 +01:00
parent 217da361b7
commit 4398a65453
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 2 additions and 1 deletions

View File

@ -77,6 +77,7 @@ if [ ! -d $backup_folder ]; then
echo "Could not create Backup folder. Please make sure you have sufficent rights to create $backup_folder"
exit 1
fi
echo "-------------------------------"
fi
# Check if the config file exists
@ -86,7 +87,7 @@ fi
date=`date +%d\-%m\-%Y\_%H\-%M\-%S`
# Delete backups older than three days if there are any
if [ ! "$(ls -A $backup_folder)" ]; then
if [ "$(ls -A $backup_folder)" ]; then
echo "Deleting Backups older than three days..."
find $backup_folder/* -type d -ctime +3 | xargs rm -rf
echo "Deleted."