Жмет файлы и базу в архивы и отсылает их в папку на диске google
#!/usr/bin/sh echo Starting site backup cd /root/backup/ dbuser="DATABASEUSERNAME" dbpass="DATABASEPASSWORD" dbname="DATABASENAME" googleparent="КОД_PARENT_ПАПКИ_НА_GOOGLE_DRIVE" now=$(date +"%Y%m%d-%H%M%S") file_system="$now-system.tar.gz" file_dbase="$now-database.gz" echo "Backup filesystem" tar -zcvf $file_system /var/www/html > /dev/null chmod 0400 $file_system echo "Backup database" mysqldump $dbname -u $dbuser --password=$dbpass | gzip -c > $file_dbase chmod 0400 $file_dbase echo "Sending content to Google Drive" # https://stackoverflow.com/questions/33063673/bash-script-to-backup-data-to-google-drive # Sources: https://github.com/prasmussen/gdrive drive upload --parent $googleparent --file $file_system drive upload --parent $googleparent --file $file_dbase