Access Denied Exception

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
nevil
Posts: 10
Joined: 08 Jun 2016, 20:06

Access Denied Exception

Post by nevil »

For some reason my script is trying to move my movies to the root directory. I had it working before, not sure what I did to make this happen.
Locking /home/nevil/.filebot/logs/amc.log
Run script [fn:amc] at [Thu Jan 12 21:11:47 EST 2017]
Parameter: unsorted = y
Parameter: seriesFormat = drive2/tvshows/{n}/Season {s}/{n} - {s00e00} - {t}
Parameter: movieFormat = {certification ==~ 'PG|G' ? 'drive2/kids' : 'drive3/movies'}/{n} ({y})/{n} ({y})
Parameter: excludeList = drive2/.excludes
Parameter: deleteAfterExtract = y
Parameter: clean = y
Argument[0]: /media/drive4/complete
Use excludes: /media/drive2/.excludes
Input: /media/drive4/complete/Patriots Day (2016)/Patriots Day (2016).mkv
xattr: [Patriots Day (2016).mkv] => [Patriots Day (2016)]
Group: [mov:patriots day 2016] => [Patriots Day (2016).mkv]
Rename movies using [TheMovieDB]
Auto-detect movie from context: [/media/drive4/complete/Patriots Day (2016)/Patriots Day (2016).mkv]
[DUPLICATE] Rename [/media/drive4/complete/Patriots Day (2016)/Patriots Day (2016).mkv] to [/Patriots Day (2016)/Patriots Day (2016).mkv]
[DUPLICATE] Failed to rename [/media/drive4/complete/Patriots Day (2016)/Patriots Day (2016).mkv]
Processed 0 files
/Patriots Day (2016)
java.nio.file.AccessDeniedException: /Patriots Day (2016)
at net.filebot.util.FileUtilities.resolveDestination(FileUtilities.java:110)
at net.filebot.util.FileUtilities.copyAs(FileUtilities.java:84)
at net.filebot.StandardRenameAction$2.rename(StandardRenameAction.java:25)
at net.filebot.StandardRenameAction$6.rename(StandardRenameAction.java:84)
at net.filebot.cli.CmdlineOperations.renameAll(CmdlineOperations.java:625)
at net.filebot.cli.CmdlineOperations.renameMovie(CmdlineOperations.java:502)
at net.filebot.cli.CmdlineOperations.rename(CmdlineOperations.java:105)
at net.filebot.cli.ScriptShellBaseClass.rename(ScriptShellBaseClass.java:336)
at Script1$_run_closure55.doCall(Script1.groovy:439)
at Script1.run(Script1.groovy:403)
at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:62)
at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:72)
at net.filebot.cli.ArgumentProcessor.runScript(ArgumentProcessor.java:114)
at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:29)
at net.filebot.Main.main(Main.java:120)
Here is my script:

Code: Select all

filebot -script fn:amc --action duplicate --conflict auto \
        -non-strict "/media/drive4/complete" --output "/media" --log-file amc.log --def unsorted=y \
        --def "seriesFormat=drive2/tvshows/{n}/Season {s}/{n} - {s00e00} - {t}" \
        "movieFormat={certification ==~ 'PG|G' ? 'drive2/kids' : 'drive3/movies'}/{n} ({y})/{n} ({y})" \
        excludeList="drive2/.excludes" \
        --def deleteAfterExtract=y \
        --def clean=y

If I run the script with sudo it will work, but the movie will end up in the root directory /Patriots Day (2016)/Patriots Day (2016).mkv
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Access Denied Exception

Post by rednoah »

{certification} is undefined for this particular movie. If {certification} fails then you're left with /{n} ({y})/{n} ({y})
which is what we see in the logs.

Here's a fix for your format:

Code: Select all

any{certification}{'NR'} ==~ 'PG|G' ? '/kids' : '/movies'
@see viewtopic.php?t=1895
:idea: Please read the FAQ and How to Request Help.
nevil
Posts: 10
Joined: 08 Jun 2016, 20:06

Re: Access Denied Exception

Post by nevil »

Im not sure what I am doing wrong.

I want everything to go to these directories:

PG or G - /media/drive2/kids
All other movies - /media/drive3/movies
Unrated or unmatched - /media/drive3/movies
TV Shows - /media/drive2/tvshows

I just donated $8 euro, if you can just modify my script for me. Much appreciated!
User avatar
rednoah
The Source
Posts: 22986
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Access Denied Exception

Post by rednoah »

WRONG, because it'll unwind if certification is undefined:

Code: Select all

certification ==~ 'PG|G'
CORRECT, because it'll either use the value of certification or default to NR:

Code: Select all

any{certification}{'NR'} ==~ 'PG|G'
@see viewtopic.php?t=1895
:idea: Please read the FAQ and How to Request Help.
Post Reply