added test if backup directory exists before old files are tried to be deleted

This commit is contained in:
André Bauer 2017-02-12 10:57:40 +01:00
parent d4a47cd3dc
commit 22e37a941b

View file

@ -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 () {