double quote find expression too

This commit is contained in:
Fco. Javier Delgado del Hoyo 2017-04-08 18:02:18 +02:00
parent da419c79b1
commit fc86bcc4cd

View file

@ -21,7 +21,7 @@ done
if [ -n "$MAX_BACKUPS" ] if [ -n "$MAX_BACKUPS" ]
then then
while [ $(find /backup -maxdepth 1 -name "*.sql.gz" | wc -l) -gt "$MAX_BACKUPS" ]; while [ "$(find /backup -maxdepth 1 -name "*.sql.gz" | wc -l)" -gt "$MAX_BACKUPS" ];
do do
TARGET=$(find /backup -maxdepth 1 -name "*.sql.gz" | sort | head -n 1) TARGET=$(find /backup -maxdepth 1 -name "*.sql.gz" | sort | head -n 1)
echo "Backup $TARGET is deleted" echo "Backup $TARGET is deleted"