Skip to content

Instantly share code, notes, and snippets.

@Yossi1114
Created December 14, 2021 17:03
Show Gist options
  • Save Yossi1114/e56c7d752e6aaab297742f86373a0814 to your computer and use it in GitHub Desktop.
Save Yossi1114/e56c7d752e6aaab297742f86373a0814 to your computer and use it in GitHub Desktop.
script for daily backup to Google Drive
#!/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