2
I am trying to accomplish a way to perform a backup using mysql and transfer the data to the cloud from google drive. I am using the mysqldump to carry out the backup and the gdrive to upload to the cloud.
https://github.com/gdrive-org/gdrive
And to automate I’m using the crontab linux. Below is the example I am using to perform such functionality.
11 08 * * * root mysqldump -u root *senha* *database* | gzip > .../caminho/backup$(date +\$Y_\%m_\%d_\%H).sql.gz
.
11 08 * * * root gdrive upload -r /caminho/backup_auto_$(date +\%Y_\%m_\%d_\%H).sql.gz -p hash_diretorio
The backup of mysqldump works well. However the gdrive does not upload to the cloud. Manually testing outside the crontab works. I’ve run several tutorials related to the subject as a solution and it still doesn’t work.