Hello, today’s blog post is all about backing up stuff to the cloud and also having copies at home locally. Doing this is very important since it is crucial to keep your data alive even when something bad happens. To do all of this, we will be using rclone, which is an awesome open-source tool for doing stuff with cloud storage.
You can use rclone with all of these services, the process will be very similar to the one I will be using (Google Drive & Google Photos):
First, install rclone, this is fairly easy:
- On Linux based systems, execute
curl https://rclone.org/install.sh | sudo bash
- On Windows, download with Chocolatey (
choco install rclone) or download it from their Downloads page
- On macOS, use
brew install rclone with Homebrew or also head to their Downloads page for the installer
Keep in mind, I will be setting up Google Drive in this example, but other apps are set up similarly.
- Open the terminal, and in your shell execute
- Choose the option
n for a new remote
- Choose a simple name (can be anything you want)
- Fill in the number corresponding to the storage option you want to use (this is remote)
- If prompted for any platform-specific details, fill them out, but for Google services, you don’t have to fill in the Client ID and the Client secret.
- Grant full access
- Enter the ID of the root folder, this can be nothing, or the end part of the URL when browsing your Drive.
- Leave the service account field empty
- Skip through the next 2 steps with the Enter key
- You will then be prompted to sign in with your default browser
- Grant access to the requested resources
n to not configure as a team drive
- You are done!
Downloading and uploading
An example use case (which I use) is backing up my stuff from my computer to Google Drive, that command would like like this:
rclone copy --update --verbose --transfers 25 --checkers 8 --contimeout 60s --timeout 300s --retries 3 --low-level-retries 10 --progress "/mnt/c/directory" remote:
To download from the remote (for example to keep a copy of all your Google Photos or Onedrive documents locally), just switch out the remote and the source path
Thanks for reading!