From 22e37a941bc0c905391e9798de264526b05ca823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Sun, 12 Feb 2017 10:57:40 +0100 Subject: [PATCH] added test if backup directory exists before old files are tried to be deleted --- contrib/backup/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/backup/functions b/contrib/backup/functions index e6f6b6b77..e7bfb270c 100644 --- a/contrib/backup/functions +++ b/contrib/backup/functions @@ -12,7 +12,7 @@ function get_backup_date () { } function delete_old_backups () { - find ${BACKUP_DIR}/*_zammad_*.gz -type f -mtime +${HOLD_DAYS} -exec rm -r \; + test -d ${BACKUP_DIR} && find ${BACKUP_DIR}/*_zammad_*.gz -type f -mtime +${HOLD_DAYS} -exec rm -r \; } function get_db_credentials () {