Is there a filebot var that outputs the original full path to file?

Support for Ubuntu and other Desktop Linux distributions
Post Reply
Rick7C2
Posts: 12
Joined: 22 Nov 2013, 23:04

Is there a filebot var that outputs the original full path to file?

Post by Rick7C2 »

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
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Is there a filebot var that outputs the original full path to file?

Post by rednoah »

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.

Code: Select all

filebot ... | grep ... | cut ... | xargs -I touch
:idea: Please read the FAQ and How to Request Help.
Rick7C2
Posts: 12
Joined: 22 Nov 2013, 23:04

Re: Is there a filebot var that outputs the original full path to file?

Post by Rick7C2 »

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...

Code: Select all

Input: /path/to/media/file.mkv 
to

Code: Select all

/path/to/media/file.mkv
Then pass execute

Code: Select all

touch /path/to/media/file.mkv
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...

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
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.
User avatar
rednoah
The Source
Posts: 22976
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Is there a filebot var that outputs the original full path to file?

Post by rednoah »

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.
:idea: Please read the FAQ and How to Request Help.
Post Reply