0

On Debian 8, I have files generated when I run this command:

docker exec mysql-gerrit sh -c 'exec mysqldump --databases reviewdb \
    -ugerrit -p"@#$456"' > /root/db_backup/`date +%Y%m%d`.sql

Today I ran this command to generate a 20220309.sql file.

But when I put this line of command in crontab, it doesn't execute.

[root@ankon:~/db_backup]# crontab -l
10 03 * * 6 docker exec mysql-gerrit sh -c 'exec mysqldump --databases reviewdb -ugerrit -p"@#$456"' > /root/db_backup/`date +%Y%m%d`.sql

I would like to ask what causes this? What should I do to solve this problem? Thanks a lot!

Lacek
  • 6,585
  • 22
  • 28
Andrew
  • 103
  • 2
  • Specifcally look under the heading "cron runs your command in a restricted environment" because that's almost certainly your issue. – Satanicpuppy Mar 09 '22 at 15:37

0 Answers0