Answer the question
In order to leave comments, you need to log in
Why is postgresql backup script not running in Cron?
Good afternoon, I have a database backup script that runs fine from the CLI, but does not run through CRON, the logs do not show anything
#!/bin/sh
# Backing up
docker exec -t pgstaff_postgres_1 pg_dumpall -c -U estaffuser | zstd > /docker/backup/estaffdb_$(date +"%Y-%m-%>
# Rotating the logs, delete older than 31 days
find /docker/backup/estaffdb_* -mtime +31 -exec rm {} \;
Answer the question
In order to leave comments, you need to log in
The problem was solved by restarting the cron service: systemctl restart cron.service
It is strange of course why this is so
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question