Scripting Tidbits: Google Drive and Rclone Backups

Scripting Tidbits: Google Drive and Rclone Backups

Every day my server runs a backup script, uploading any new files and changes to Google Drive. Here's the (sanitized) script:

Things to note:

  • I have a gigabit fiber home internet connection, so bandwidth throttling is not a concern to me. There are rclone flags for bandwidth throttling if that is a concern.
  • It took me almost a month (and a slightly different script) to get an initial backup of all my data to Google Drive, this script focuses on keeping things up-to-date so I don't need to do that again.
  • I'm currently just running this daily via a cron job. Nothing fancy, and it logs to a known directory that I check on every once in awhile.
  • The only dependency to run this script is that rclone is installed and a remote (I call mine google-drive in the script) is configured. Instructions on how to install can be found here and instructions on configuration can be found here.