1
0
Fork
You've already forked protondrive-cli-sync
0
Simple script for utilizing proton-drive-cli to sync directories on Linux/BSD systems.
  • Shell 100%
2026年06月19日 14:08:26 -06:00
pdrive-cli-sync.sh Update README and add notes to source. 2026年06月19日 14:08:26 -06:00
README.md Update README and add notes to source. 2026年06月19日 14:08:26 -06:00

pdrive-cli-sync.sh

A Bash wrapper for syncing directories to Proton Drive utilizing proton-drive-cli. Useful for configuring cron jobs.

NOTE: If you only have a single path to backup, this wrapper just adds extra steps. This is useful if you specifically want to iterate over a set of paths to backup to the same location on Proton Drive.

Setup

  1. Download proton-drive.
  2. Add the executable flag to proton-drive: chmod +x proton-drive.
  3. Perform the steps to authenticate your account: ./proton-drive auth login.
  4. Set the configuration variables in pdrive-cli-sync.sh.

Configuration

All required parameters are simply for passing values to the upload endpoint of the proton-drive application.

  1. Set PDRIVE_CLI_PATH to set the path where the proton-drive executable is stored.
  2. Set PDRIVE_SYNC_PATH to set the directory to write to within Proton Drive.
  3. Set the SYNC_DIRS for the values of all discrete paths to backup to PDRIVE_SYNC_PATH.
  4. OPTIONAL:
    • Setting PDRIVE_CONFLICT, PDRIVE_FILE_CONFLICT or PDRIVE_FOLDER_CONFLICT all have the values of "merge", "keep-both", "replace" or "skip." PDRIVE_CONFLICT is hierarchical to FILE/FOLDER.
    • Setting PDRIVE_SKIP_THUMBNAILS simply is true|false.

Usage

To perform a check of the configuration before syncing:

$ bash pdrive-cli-sync.sh -c

To run the sync, simply pass with no arguments once the parameters are set in the script:

$ bash pdrive-cli-sync.sh

To set in a cron job for your user:

$ crontab -e

And then set a schedule in your editor:

@weekly /bin/bash /path/to/pdrive-cli-sync.sh

Troubleshooting

"proton-drive executable not found"

  • Ensure PDRIVE_CLI_PATH points to the correct location
  • Verify the file is executable: chmod +x /path/to/proton-drive

"Directory does not exist"

  • Verify all paths in SYNC_DIRS are correct
  • Use absolute paths (starting with / or ~/)
  • Check directory permissions

Sync failures

  • Check your Proton Drive credentials
    • NOTE: proton-drive CLI does not provide auth check - credential store may have an expiry timeframe.

TODO

  • Provide method upstream to tool for performing auth checks.
  • Provide logging path/parameters and verbosity settings.
  • Add commandline overrides.
  • Add ability to pass dynamic directory paths and destiations in configuration file.
  • Add error handling for nonexistent local/remote paths.
  • Determine a method for adding file/folder exclusions.