[Linux] Backup + Upload - Google Drive
Create a directory:
The directory can be inside the server folder.
Suggested name: backup_DB
Creating a database backup:
Create a .sh file in the server folder
Create a cron job on Linux to run the .sh file on a scheduled basis:
The suggestion is to have two times to generate 2 .sql files, the first at 6:10 after the default servesave, and the other at 23:10 after the server is busy.
Adding cron to Linux Cron will execute the backup .sh file automatically.
Open the cron list:
Cron:
Remember: change the machine's time to your local time, for example:
sudo timedatectl set-timezone America/Sao_Paulo
This will ensure that cron runs the .sh files at the correct time.
Permission for the .sh file:
After saving the .sh file with the code, add the permission so it can be executed:
Credits: Leotk.
Last updated