Docker image to perform a rclone sync based on a cron schedule, with healthchecks.io monitoring.
rclone is a command line program to sync files and directories to and from:
rclone needs a configuration file where credentials to access different storage provider are kept.
By default, this image uses a file /config/rclone.conf and a mounted volume may be used to keep that information persisted.
A first run of the container can help in the creation of the file, but feel free to manually create one.
$ mkdir config
$ docker run --rm -it -v $(pwd)/config:/config pfidr34/rclone
A few environment variables allow you to customize the behavior of rclone:
SYNC_SRC source location for rclone sync/copy/move commandSYNC_TEMP dir location for rclone sync/copy/move command to use as temp staging areaSYNC_DEST destination location for rclone sync/copy/move commandSYNC_OPTS additional options for rclone sync/copy/move command. Defaults to -vRCLONE_CMD set variable to sync copy or move when running rclone. Defaults to syncRCLONE_DIR_CMD set variable to ls or lsf for source directory check style. Defaults to lsRCLONE_DIR_CHECK_SKIP set variable to skip source directory check before sync. Use with cautionCRON crontab schedule 0 0 * * * to perform sync every midnight. Also supprorts cron shortcuts: @yearly @monthly @weekly @daily @hourlyCRON_ABORT crontab schedule 0 6 * * * to abort sync at 6amCRON_CLEAR crontab schedule 30 23 * * * to clear download directory at 23:30FORCE_SYNC set variable to perform a sync upon bootCHECK_URL healthchecks.io url or similar cron monitoring to perform a GET after a successful syncFAIL_URL Fail URL to perform a GET after unsuccessful execution. By default this is CHECK_URL with appended "/fail" at the endSYNC_OPTS additional options for rclone sync command. Defaults to -vOUTPUT_LOG set variable to output log file to /logsROTATE_LOG set variable to delete logs older than specified days from /logsTZ set the timezone to use for the cron and log America/Chicago$ docker run --rm -it -v $(pwd)/config:/config -v /path/to/source:/source -e SYNC_SRC="/source" -e SYNC_DEST="dest:path" -e TZ="America/Chicago" -e CRON="0 0 * * *" -e CRON_ABORT="0 6 * * *" -e FORCE_SYNC=1 -e CHECK_URL=https://hchk.io/hchk_uuid pfidr34/rclone
See rclone sync docs for source/dest syntax and additional options.
Credit to Brian J. Cardiff for the orginal project @ https://github.com/bcardiff/docker-rclone
Content type
Image
Digest
Size
13.9 MB
Last updated
about 7 years ago
docker pull kgotso/rclone