Headless OneDrive Backup
I am trying to cut cost before the new year and one of the costs that I have is a per GB backup solution using Linode's S3-compatible Object Storage for offsite backup. My total offsite backup space is only around 150GB right now because I'm mainly capturing Db backups, duplicati meta-information, and some raw media files.
To cut this cost, the best solution I can think of is OneDrive. I am already paying for a subscription to OneDrive for Office app access and OneDrive space / file sharing for my family. Since this in my mind is a "sunk" cost that includes the rest of my family, I looked into how I can automate my backups to OneDrive like I do now to Linode's Object Storage.
The main guide that I followed for this is https://rclone.org/onedrive/. It handled most everything I had questions about with a few minor exceptions:
- What client Id should I use?
- Answer: It is the main Application (client) ID value in the main App registrations -> Overview page.
- Why did I get an unauthorized error when I first tried to use it?
- Answer: I am using Ubuntu 20.04 LTS for the server doing the backup and the default rclone version on there is 1.50. There is a known bug with this version. I instead downloaded the latest .deb from https://github.com/rclone/rclone/releases via wget on my server and ran "sudo apt install ./nameoffile" to install the newest version
- How best to do this sync?
- Answer: This may be incorrect but the way I am doing this now instead of rclone copy is rclone sync. Command is similar to "rclone sync /opt remote:RcloneBackup"
I have a bash script via crontab setup to run this script nightly to ensure all incremental backups are backed up now to OneDrive. This is the same solution I had for Linode Object Storage.
If you find this article and have any questions, feel free to reach out to joe@spoonnet.net or comment below.