fixed checking if the backup folder is empty
This commit is contained in:
parent
217da361b7
commit
4398a65453
|
@ -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"
|
echo "Could not create Backup folder. Please make sure you have sufficent rights to create $backup_folder"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
echo "-------------------------------"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if the config file exists
|
# Check if the config file exists
|
||||||
|
@ -86,7 +87,7 @@ fi
|
||||||
date=`date +%d\-%m\-%Y\_%H\-%M\-%S`
|
date=`date +%d\-%m\-%Y\_%H\-%M\-%S`
|
||||||
|
|
||||||
# Delete backups older than three days if there are any
|
# 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..."
|
echo "Deleting Backups older than three days..."
|
||||||
find $backup_folder/* -type d -ctime +3 | xargs rm -rf
|
find $backup_folder/* -type d -ctime +3 | xargs rm -rf
|
||||||
echo "Deleted."
|
echo "Deleted."
|
||||||
|
|
Loading…
Reference in New Issue