rclone / rclone-webui-react

A full fledged UI for the rclone cloud sync tool
MIT License
1.26k stars 161 forks source link

Question: How to use docker image with regular syncs and webui? #89

Open Apollo3zehn opened 4 years ago

Apollo3zehn commented 4 years ago

I am running the docker image with the following command (powershell):

sudo docker run `
    --detach `
    --name rclone `
    --publish 127.0.0.1:8004:5572 `
    --restart always `
    --volume /<local config path>:/config/rclone `
    --volume /<local data path>:/data:shared `
        rclone/rclone:beta `
        rcd --rc-web-gui `
            --rc-web-gui-no-open-browser `
            --rc-addr 0.0.0.0:5572 `
            --rc-user yyy `
            --rc-pass xxx

With this I am able to access the webui via http://127.0.0.1:8004.

I have a cron job which runs once per day and starts the rclone sync. Something like this (simplified):

0 1 * * * root docker exec rclone rclone sync local:/data crypt:/backup

With this setup, I can't see the activity within the webui since these are two different processes. Which makes sense.

I could adapt the docker command so that I am not using cron anymore but instead use a while loop with sleep time to run the sync command, similar to what I am using for nginx:

docker run nginx:1.17.4 -c 'while :; do sleep 6h & wait ${!}; nginx -s reload; done & nginx -g \"daemon off;\"'

With a command similar to the one for nginx I could do a sync and expose the --rc connection. But whenever the sync is finished, the webui will stop running.

My question: Is there any way to have the webui always running in a docker container and start sync regularly in parallel so the sync activity is shown in the webui?

negative0 commented 4 years ago

No, not right now. But, we are working on integrating all commands in rc. After that is done, you should be able to run rclone rc to run your commands

timdonovanuk commented 3 years ago

So is there any way to actually see rclone commands run from a shell (inside the container) in the webUI (also running in the container)?