I'm using filebot amc script. I would like to add a command in the -exec that will touch the original file path after it is processed.
I alreaddy touched the paths in my excludes list but I would like to to touch the files as they are processed instead of touching all of them over and over via excludes list.
Is there a filebot var that will output the full path to the original file so that I could add command to exec example...
touch {filebotvar}
that would be
touch /full/path/to/original/file.mkv
Is there a filebot var that outputs the original full path to file?
Re: Is there a filebot var that outputs the original full path to file?
Unfortunately, there is no variable that would give you the original path of the file in case of copy operations.
However, you can easily capture the console output, grep all the Input: /path/to/file lines and then touch those.
e.g.
However, you can easily capture the console output, grep all the Input: /path/to/file lines and then touch those.
e.g.
Code: Select all
filebot ... | grep ... | cut ... | xargs -I touch
Re: Is there a filebot var that outputs the original full path to file?
You are a genius! haha I forgot that you can pipe commands together like that.
One question though.
If I run the command
filebot ... | grep -oP '(?<=Input: ).+' | xargs -I touch
This will grep all lines that contain...
to
Then pass execute
Problem is will the full command grep and touch while filebot is running or will filebot finish completely then grep completely then touch?
The reason I ask is that after looking at the output of filebot I get the following...
If it greps and touches while filebot is still running I'm afraid it will touch the file before the media file is moved therefore making filebbot move a 0byte file with no content. That I do not want.
I know touch command if used on an existing file just updates the timestamp. But these files are in a google drive mount and for some reason if you touch an existing file it replaces it with a empty file.
One question though.
If I run the command
filebot ... | grep -oP '(?<=Input: ).+' | xargs -I touch
This will grep all lines that contain...
Code: Select all
Input: /path/to/media/file.mkv
Code: Select all
/path/to/media/file.mkv
Code: Select all
touch /path/to/media/file.mkv
The reason I ask is that after looking at the output of filebot I get the following...
Code: Select all
Input: /root/gdrive/Incoming/TV Shows/Bobs.Burgers.S08E02.720p.HDTV.x264-AVS.mkv
Group: [tvs:bobs burgers] => [Bobs.Burgers.S08E02.720p.HDTV.x264-AVS.mkv]
Rename episodes using [TheTVDB]
Auto-detected query: [Bobs Burgers]
Fetching episode data for [Bob's Burgers]
[MOVE] From [/root/gdrive/Incoming/TV Shows/Bobs.Burgers.S08E02.720p.HDTV.x264-AVS.mkv] to [/root/gdrive/Media Server/TV Shows/Bob's Burgers/Season 08/Bob's Burgers - S08E02 - 2017-10-15 - The Silence of the Louise HDTV-720p.mkv]
Processed 1 files
I know touch command if used on an existing file just updates the timestamp. But these files are in a google drive mount and for some reason if you touch an existing file it replaces it with a empty file.
Re: Is there a filebot var that outputs the original full path to file?
It'll run in parallel.
If you want to run it afterwards then you could just pipe the output to a file and grep from that file later after FileBot is done.
If you want to run it afterwards then you could just pipe the output to a file and grep from that file later after FileBot is done.