Infos:
-
Used Zammad version: 4.1.x
-
Used Zammad installation type: package
-
Operating system: debian 10
-
Browser + version:
Expected behavior:
-
Zammad files and postgresql database to backup successfully
-
With this output
# Zammad backup started - Thu Jun 24 00:20:01 CEST 2021!
creating file backup...
creating postgresql backup...
# Zammad backuped successfully - Thu Jun 24 00:20:58 CEST 2021!
Actual behavior:
- Postgresql database is not backupped without changes to /opt/zammad/contrib/backup/functions
# Zammad backup started - Sun Jul 4 00:20:01 CEST 2021!
creating file backup...
creating postgresql backup...
Password: su: Authentication failure
mv: cannot stat '/tmp/20210704002001_zammad_db.psql.gz': No such file or directory
# Zammad backuped successfully - Sun Jul 4 00:20:59 CEST 2021!
Steps to reproduce the behavior:
- Execute
/opt/zammad/contrib/backup/zammad_backup.sh
while running Zammad with postgresql as the Zammad user. - add
20 0 * * * /opt/zammad/contrib/backup/zammad_backup.sh
to crontab of zammad user
Temporary solution:
-
change line 54 inside
/opt/zammad/contrib/backup/functions
fromsu -c "pg_dump -c ${DB_NAME} | gzip > /tmp/${TIMESTAMP}_zammad_db.psql.gz" postgres
topg_dump -c ${DB_NAME} | gzip > /tmp/${TIMESTAMP}_zammad_db.psql.gz
-
The problem with this solution is that the script gets overwritten after an Zammad update. This is not really a durable solution sadly.
Remarks
-
The documentation says that cronjobs should be executed using the Zammad user. This is not possible when using a postgresql database
-
link to documentation: Backup and Restore — Zammad documentation
Final questions
- Should I use the Root for executing the cronjobs?
Thank you for your time