Backup cronjob with postgresql as Zammad user


  • 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/ while running Zammad with postgresql as the Zammad user.
  • add 20 0 * * * /opt/zammad/contrib/backup/ to crontab of zammad user

Temporary solution:


Final questions

  • Should I use the Root for executing the cronjobs?

Thank you for your time :slight_smile:

Right now the best way for backing up is using the root user.
If that’s not an option for you, you could copy away the backup scripts and adjust functions as needed.

With the next version the backup scripts will support more situations which may solve your issue as well.
See: Maintenance: Improve backup and restore handling. by mgruner · Pull Request #3621 · zammad/zammad · GitHub

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.