Rclone workflow auto upload

Hey :slight_smile:

I would like to set up a workflow with rclone but I'm not quite sure if this will work at all.
That's why I ask here if someone has a good idea how I could implement this exactly.

What i need

I work with a Linux Ubuntu server and Google Drive. I have installed Jdownloader as a docker image and sometimes download ZIP files with videos from friends (MP4, MKV, MOV). When the files are done downloading, the jdownloader extracts the files automatically. Once that is done, I want Rclone to upload the files to Google Drive that the files are no longer local to the server. Is there a good solution for this? Maybe that it ignores certain endings like ".zip" ? And would I then have to work with a cache and if so how exactly what is recommended?

Thanks for help

hi,

can run a command, for example, something like this
rclone move /path/to/videos gdrive:videos --exclude=*.zip --dry-run

Thank you
Is there a way that Rclone always checks if there are new files and then runs them and everything in the background?

no. tho, that should not be a problem, as you are using rclone move

--- write a simple script that runs rclone move in a timed loop
or
--- tell jdownloader, that once a file has downloaded, run a script with that rclone move command

How should this script be executed?
With cron or how do they recommend it? Is there perhaps an example code?

yes, can use cron.

tho i would post at jdownloader forum, they will have the best answer.
about how to run a command once a file has finished downloading.

I have just often had problems with cron when I have run scripts that have taken a certain amount of time.
That's why I'm a little unsure.

the internet is full of solutions.

https://stackoverflow.com/questions/10552016/how-to-prevent-the-cron-job-execution-if-it-is-already-running
https://serverfault.com/questions/82857/prevent-duplicate-cron-jobs-running

I was able to implement this now so many thanks. one question, when i do move and folders are there, it creates the folders in the remote directory and moves the files, but does not delete the empty folders locally. Is there a way to do that?

1 Like

good to hear that!

--delete-empty-src-dirs Delete empty source dirs after move

Im running a python script with screen, that check a source folder every x time and move to remote,

Can you tell me how you do that with screen that you have controlled sessions?
I've often had several sessions with the same name and then there were a few problems.
Advantage with screen would be you could see the current status.
I have now solved it with a shell script loop and systemd.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.