This image provides an easy way to have a docker container run periodic rclone scripts and the ability to run as an arbitrary user (in particular non-root).
- Write a bash script that does what you want, e.g. multiple rclone commands to copy / move your stuff.
- Edit the crontab file to match your needs. You can also use pre-configured directories like
/etc/periodic/daily
- Ensure that the file name of the mounted scripts does not contain a ".", i.e. do not use
script.sh
as a file name inside the container. - Mount your script(s) into the appropriate paths inside the container
Example (bare docker command):
docker run -e PUID=$(id -u) -e PGID=$(id -g) -v ${PWD}/crontab:/etc/supercronic/crontab -v ${PWD}/hello.sh:/etc/periodic/custom/hello --rm -it gibibyte/rclone-supercronic
Note: When using run-parts
in the crontab, the scripts must not have a file extension (e.g. .sh
). See man page
The Dockerfile adds supercronic on top of the official rclone Docker image and an entrypoint using su-exec
to drop root privileges.