Setting up an automated backup from my Debian server to Proton Drive using rclone was a task that combined practicality with a touch of innovation. Here's how I achieved this:

1. Installing rclone:

Proton Drive support was introduced in rclone version 1.64.0 beta. To ensure compatibility, I manually installed the latest version:

curl -O https://downloads.rclone.org/rclone-current-linux-amd64.deb
sudo dpkg -i rclone-current-linux-amd64.deb

2. Configuring rclone for Proton Drive:

Given that my server operates headlessly, I had to perform the authentication on a machine with a graphical interface (my Mac) and then transfer the credentials. Here's the process:

  • On the Debian Server:
    1. Followed the prompts:
      • Selected n for a new remote.
      • Named it protondrive.
      • Chose protondrive as the storage type.
      • Entered my Proton Mail credentials.
      • Opted n for auto config due to the headless setup.
  • On the Mac (PC or whatever):
    1. Ensured the same rclone version was installed.
    2. After authorising, obtained a token.
  • Back on the Debian Server:
    1. Pasted the token into the rclone prompt to complete the setup.

Ran:

rclone authorize "protondrive"

Received the following message:

For this to work, you will need rclone available on a machine that has a web browser available.
Execute the following on the machine with the web browser (same rclone version recommended):
  rclone authorize "protondrive"
Then paste the result.

Initiated the configuration:

rclone config

3. Automating Backups with Cron:

To keep my /srv/data and /srv/photography directories backed up to Proton Drive, I set up cron jobs:

    • The --create-empty-src-dirs flag ensures that empty directories are preserved.
    • Logs are stored for monitoring purposes.

Added the following lines to schedule daily backups at 2am and 2.30am:

0 2 * * * rclone copy -v /srv/data protondrive:data --create-empty-src-dirs --log-file /var/log/rclone-data.log
30 2 * * * rclone copy -v /srv/photography protondrive:photography --create-empty-src-dirs --log-file /var/log/rclone-photography.log

Edited the crontab:

crontab -e

4. Monitoring and Maintenance:

I periodically check the log files to make sure the backups are still running okay:

tail -f /var/log/rclone-data.log

This setup provides a reliable and automated backup solution, ensuring my data is securely stored on Proton Drive without manual intervention.