rclone-jobman is a "job manager" that aims to simplify managing multyple sync jobs with rclone.
I first wrote it as a very simple script for my specific necessities, but later I thought it would be a good exercice to try and make it more convenient for general use. So I expanded it adding subscripts for adding, editing and removing jobs.
For now, the rclone arguments are "hard-coded" (I mean, this is a script after all...) for the way I use rclone. I may change this in the future and make the arguments job-specific, saving them on the job file instead.
If rclone-jobman is called without any argument (the main intended use), it will run in interactive mode. It will print a menu listing all the available jobs and options and wait for user input. Here you can run a sync job or create/edit/remove one.
Alternatively, it can be called with only one argument that should be the name of a job file (only the basename, not the full path). It will run this specific job and exit. This is intended to be used to automate backups, for example using cron (see example file).
Each job is defined on a job file which defines a descriptive name, a source and a destination paths, and if the rclone should be run with the --dry-run option. The basename of each job file will be used to uniquely identify it.
Each job has three more files, that must be named with the same unique basename:
- A filterfrom file defines the patters that rclone will use to filter files from the source directory (see https://rclone.org/filtering/#filter-from-read-filtering-patterns-from-a-file)
- A log file, where rclone will save the log of the last run. This file is erased at the start of every run.
- A lock file, used with flock to prevent the job to be started if the last execution has not ended, which could happen when used with automation.
The main script rclone-jobman.sh is intended to be put
(or linked to)
on one of the $PATH
directories.
The other subscripts (rclone-jobman-*.sh) must be in the same directory,
with the main script.
The job files must be put under the $HOME/.config/
directory
following this structure:
rclone-jobman/jobs/
: job filesrclone-jobman/filterfrom/
: filterfrom filesrclone-jobman/log/
: log filesrclone-jobman/lock/
: lock files
I provide a desktop entry file
for executing the main script on a terminal
from the graphical desktop environment:
rclone-jobman.desktop.
It should be placed under $HOME/.local/share/applications/
.
For it to show an icon correctly,
rclone.png
must be placed under $HOME/.local/share/icons/
(this file is taken from the
rclone-webui-react repository).
I provide a script named install-rclone-jobman.sh that "installs" all the files (including the desktop entry and icon) on the user environment, and creates the necessary subdirectories under .config.