Hello,
I cannot find the solution to what I believe is a "simple problem":
I download my movies into a Linux folder: /media/movies
I do not use any subfolder. i.e. all MKV files are under /media/movies
Everytime I download a new movie, I want to run the command "touch" on the file download (and only this file, not on the other files of the /media/movies folder"
I understand that the parameters available to the post-processing scripts are $1, $2, $3
1 The final directory of the job (full path)
2 The original name of the NZB file
3 Clean version of the job name (no path info and ".nzb" removed)
How do I create a script that will do "touch /media/movies/filename.mkv" on each new file downloaded?
Thanks for your help.
[Bash] Run command for every new file downloaded
Re: [Bash] Run command for every new file downloaded
SAB does not 'feed' all the separate files downloaded towards a post-processing script.
But ... mabye Linux itself (you use Linux, right?) can help: from the post-processing script, run a command "find -cmin -30" to find files which status was changed in the last 30 minutes, and touch those files. I'm assuming/hoping that "status change" only happens on creating, not on accessing ... some tests confirm that.
-cmin n
File's status was last changed n minutes ago.
But ... mabye Linux itself (you use Linux, right?) can help: from the post-processing script, run a command "find -cmin -30" to find files which status was changed in the last 30 minutes, and touch those files. I'm assuming/hoping that "status change" only happens on creating, not on accessing ... some tests confirm that.
-cmin n
File's status was last changed n minutes ago.
Re: [Bash] Run command for every new file downloaded
From what I understand, your problem is that the timestamp is from when the mkv was generated, but you want it to be the day you downloaded the file? Unless the mkv file name is always the same as the job name + .mkv I think it would be easier to touch it and then move it to the movies folder.
Re: [Bash] Run command for every new file downloaded
If the problem is what Puzzled describes, you can also use the Config > Special option "ignore_unrar_dates", which will set the date of all unpacked files to the current date/time.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Re: [Bash] Run command for every new file downloaded
Thanks to all of you guys, that's helpful.
I will try the special option first.
I will try the special option first.
Re: [Bash] Run command for every new file downloaded
Just to note that this only works for Rar files, since it's an option we add to the UnRar command.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate