Cron doesn't run
I have the following crontab -e on my server:
# Create daily gzipped DB-Backup
0 3 * * * /bin/docker exec -t database pg_dumpall -c -U root | gzip > storage/db-backups/dump_$(date +\%F_%H_%M_%S).sql.gz
# Delete DB-Backups older than 30 days
0 3 * * * /usr/bin/find storage/db-backups -name "*.sql.gz" -type f -mtime +30 -exec rm -f {} \;
When I execute the commands manually, they do exactly what they should.
But with cron, nothing happens, and the storage/db-backups stays empty.
I have already checked if cron is running (service cron status):
● cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
Active: active (running) ...
(so everything should be fine?)
Also, cron doesn't log any errors (grep CRON /var/log/syslog):
...
Nov 19 03:00:01 debian CRON[447388]: (root) CMD (/usr/bin/find storage/db-backups -name "*.sql.gz" -type f -mtime +30 -exec rm -f {} \;)
Nov 19 03:00:01 debian CRON[447389]: (root) CMD (/bin/docker exec -t database pg_dumpall -c -U root | gzip > storage/db-backups/dump_$(date +%F_)
...