rija / docker-nginx-fpm-caches-wordpress

Wordpress (no DB server included) running with Nginx in a Docker container with caching and encryption enabled
Other
23 stars 7 forks source link

Cronjob for database backup fails #10

Closed rija closed 6 years ago

rija commented 6 years ago

the created backup file only contains:

Usage: mysqldump [OPTIONS] database [tables]
OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR     mysqldump [OPTIONS] --all-databases [OPTIONS]
For more options, use mysqldump --help

Given, all env variables are set up correctly, it most likely indicates that the cron line:

@daily      ( date ; mv /root/sql/wordpress.sql /root/sql/wordpress.sql.old ; mysqldump -h $DB_HOSTNAME -u $DB_USER -p$DB_PASSWORD

doesn't recognize the env variables.

Corresponding stack overflow discussion: https://stackoverflow.com/questions/2229825/where-can-i-set-environment-variables-that-crontab-will-use#10657111