Created
December 14, 2021 17:03
-
-
Save Yossi1114/e56c7d752e6aaab297742f86373a0814 to your computer and use it in GitHub Desktop.
script for daily backup to Google Drive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Google Drive Backup Script | |
# Refer to https://medium.com/swlh/using-rclone-on-linux-to-automate-backups-to-google-drive-d599b49c42e8 and set up rclone first | |
# Connection to your Google Drive must be established with rclone before upload | |
now=$(date +"%m%d%Y") | |
/usr/bin/zip -r backup_$now.zip /var/www/ # backup file/directory path | |
/usr/bin/rclone copy --update --verbose --transfers 30 --checkers 8 --contimeout 60s --timeout 300s --retries 3 --low-level-retries 10 --stats 1s "backup_$now.zip" "gdrive://" | |
/usr/bin/rm backup_$now.zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment