gdrive error in crontab

Asked

Viewed 263 times

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.

1 answer

0


The best tutorial I saw to use this feature was this below.

https://medium.com/auto-backup-mysql-to-google-drive/auto-backup-mysql-to-google-drive-c8b2178b097e

In order to install correctly and work on the Linux crontab. The gdrive executable must be transferred to the /usr/bin directory. Using the Linux Homebrew will not work that way. The right thing would be to download the executable to your machine, change the name of this executable to gdrive (mv command), and thus give a cp gdrive /user/bin.

Where the executable should be downloaded: https://github.com/gdrive-org/gdrive

There is also another alternative in this tutorial above.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.