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:
- Google Drive
- Amazon S3
- Openstack Swift / Rackspace cloud files / Memset Memstore
- Dropbox
- Google Cloud Storage
- Amazon Drive
- Microsoft OneDrive
- Hubic
- Backblaze B2
- Yandex Disk
- SFTP
- FTP
- HTTP
- The local filesystem
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 reimannf/docker-rclone
A few environment variables allow you to customize the behavior of the sync:
MODErclone mode likesync,copy,check,cryptcheck. Defaults tosync.SYNC_SRCsource location forrclone synccommandSYNC_DESTdestination location forrclone synccommandCRONcrontab schedule0 0 * * *to perform sync every midnightCRON_ABORTcrontab schedule0 6 * * *to abort sync at 6amFORCE_SYNCset variable to perform a sync upon bootCHECK_URLhealthchecks.io url or similar cron monitoring to perform aGETafter a successful syncSYNC_OPTSadditional options forrclone synccommand. Defaults to-vTZset the timezone to use for the cron and logAmerica/Argentina/Buenos_Aires
$ docker run --rm -it \
-v $(pwd)/config:/config \
-v /path/to/source:/source \
-e MODE=copy \
-e SYNC_SRC="/source" \
-e SYNC_DEST="dest:path" \
-e TZ="Europe/Berlin" \
-e FORCE_SYNC=1 \
-e CRON="0 0 * * *" \
-e CRON_ABORT="0 6 * * *" \
-e CHECK_URL=https://hchk.io/hchk_uuid \
reimannf/docker-rcloneSee rclone documentation for source/dest syntax and additional options.