more shellcheck fixes

This commit is contained in:
André Bauer 2019-02-04 21:47:54 +01:00
parent c8666402c4
commit 544f84853d
2 changed files with 7 additions and 7 deletions

View File

@ -5,5 +5,5 @@ set -e
if [ "$1" = 'zammad-memcached' ]; then if [ "$1" = 'zammad-memcached' ]; then
echo "starting memcached..." echo "starting memcached..."
exec memcached -m ${MEMCACHED_SIZE} exec memcached -m "${MEMCACHED_SIZE}"
fi fi

View File

@ -22,17 +22,17 @@ function zammad_backup {
echo "${TIMESTAMP} - backuping zammad..." echo "${TIMESTAMP} - backuping zammad..."
# delete old backups # delete old backups
if [ -d "${BACKUP_DIR}" ] && [ -n "$(ls ${BACKUP_DIR})" ]; then if [ -d "${BACKUP_DIR}" ] && [ -n "$(ls "${BACKUP_DIR}")" ]; then
find ${BACKUP_DIR}/*_zammad_*.gz -type f -mtime +${HOLD_DAYS} -exec rm {} \; find "${BACKUP_DIR}"/*_zammad_*.gz -type f -mtime +"${HOLD_DAYS}" -exec rm {} \;
fi fi
if [ "${NO_FILE_BACKUP}" != "yes" ]; then if [ "${NO_FILE_BACKUP}" != "yes" ]; then
# 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}"
fi fi
#db backup #db backup
pg_dump --dbname=postgresql://${POSTGRESQL_USER}@${POSTGRESQL_HOST}:${POSTGRESQL_PORT}/${POSTGRESQL_DB} | gzip > ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.psql.gz pg_dump --dbname=postgresql://"${POSTGRESQL_USER}"@"${POSTGRESQL_HOST}":"${POSTGRESQL_PORT}"/"${POSTGRESQL_DB}" | gzip > "${BACKUP_DIR}"/"${TIMESTAMP}"_zammad_db.psql.gz
} }
if [ "$1" = 'zammad-backup' ]; then if [ "$1" = 'zammad-backup' ]; then
@ -43,7 +43,7 @@ if [ "$1" = 'zammad-backup' ]; then
zammad_backup zammad_backup
# wait until next backup # wait until next backup
sleep ${BACKUP_SLEEP} sleep "${BACKUP_SLEEP}"
done done
fi fi