Systemd path in Downloads folder. Can it be made to wait until the download is finished before activating the script?

I agree , why not use wget xxx && move :rofl:

We can also use a systemd timer :
every hour:

  • get list files (ls -1 *.mkv)
    for all files (multi download ?)
    • run stat $file
      if “Change” > 30 minutes, then move in ~/Videos/
1 Like

As is often the case
in order to receive any useful answer
it all boils down to:

what are you trying to achieve?
… a bigger picture view, perhaps …

its any and all downloads. web browsers included. Anything that gets put in the download directory, for any reason.

Something like this might work… I will play around with it later and look into the stat command a bit more

The easiest thing that I can think about right now is:
keep the Downloads Folder clean - only put in there the intended things
then poll it periodically - and put whatever it is in there … where you want to have it …

1 Like

if you base it off of time, it might still do what it is doing now though. Although, probably less frequently, but you could still move an incomplete file. For example, a large file being downloaded, or even any file being downloaded from a slow server

If there is a simple way to detect when writes are done, and not simply paused or delayed, then that will probably work, I don’t have time today to try anything mentioned here and I want to read the one link that was given, maybe tomorrow.

rhetorical question:
Why is it important to move completed downloads from there to somewhere else?

not rhetorical:
to be able to do this, a method of knowing when a download is finished is needed
(file size does not increase anymore … but even this criterion is unreliable)

the purpose behind this probably allows for different solutions
But we don’t know what the ultimate goal and motivation for this kind of solution is.