changed backup delete check
This commit is contained in:
parent
a1dd2ba876
commit
46865a0ad7
@ -16,7 +16,9 @@ function zammad_backup {
|
|||||||
echo "${TIMESTAMP} - backuping zammad..."
|
echo "${TIMESTAMP} - backuping zammad..."
|
||||||
|
|
||||||
# delete old backups
|
# delete old backups
|
||||||
test -d ${BACKUP_DIR} && find ${BACKUP_DIR}/*_zammad_*.gz -type f -mtime +${HOLD_DAYS} -exec rm {} \; || true
|
if [ -d "${BACKUP_DIR}" ] && [ -n "$(ls ${BACKUP_DIR})" ]; then
|
||||||
|
find ${BACKUP_DIR}/*_zammad_*.gz -type f -mtime +${HOLD_DAYS} -exec rm {} \;
|
||||||
|
fi
|
||||||
|
|
||||||
# tar files
|
# tar files
|
||||||
tar -czf ${BACKUP_DIR}/${TIMESTAMP}_zammad_files.tar.gz ${ZAMMAD_DIR}
|
tar -czf ${BACKUP_DIR}/${TIMESTAMP}_zammad_files.tar.gz ${ZAMMAD_DIR}
|
||||||
|
Loading…
Reference in New Issue
Block a user