Delete after AccessDeniedException

All your suggestions, requests and ideas for future development
Post Reply
whocares
Posts: 17
Joined: 11 Oct 2014, 22:19

Delete after AccessDeniedException

Post by whocares »

script running after d/l with nzbget. unfortunately this happened

Code: Select all

filebot_german: [MOVE] from [_source_] to [_target_]
filebot_german: Processing 1 unsorted files
filebot_german: AccessDeniedException: _target_
filebot_german: Processed 0 files
filebot_german: [MOVE] Failure: java.nio.file.AccessDeniedException: _target_
Post-process-script filebot_german.py for name successful
filebot_german: + exit 93
filebot_german: + [ 0 = 0 ]
filebot_german: Done ヾ(@⌒ー⌒@)ノ
filebot_german: Delete _source_
filebot_german: Clean clutter files and empty folders
filebot_german: Processed 1 files
So it had an AccessDeniedException but still deleted the source file. I don't think it's intended.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Delete after AccessDeniedException

Post by rednoah »

Well, it's your shell script that's doing the deleting. What exactly are you calling? What are your scripts? How do you collect logs?

The logs (it seems to be jumbled up, so it's a bit hard to tell what's happening in what order) indicates that you're calling the amc script (which runs and fails and doesn't delete anything) and then the cleaner script in your own script separately, so each of these calls are completely independent of each other, and the cleaner script ultimately simply does what it is told.

You'll need to modify your script to not run the cleaner script (or run it with different more conservative options) if the amc script indicates an error.



:!: Make sure to redirect IO correctly, so that stdout and stderr are synchronized, because with stdout and stderr having their own buffer each, you may end up with jumbled up logs that don't make sense because things don't show up in the correct order.
:idea: Please read the FAQ and How to Request Help.
whocares
Posts: 17
Joined: 11 Oct 2014, 22:19

Re: Delete after AccessDeniedException

Post by whocares »

Oh sorry.. you are right. It was quite late and I did a little mistake copy/pasting the logs.

Oh I just call the amc script with

Code: Select all

filebot -script fn:amc --output "$CONFIG_OUTPUT" --action move --conflict skip -non-strict --log-file amc.log --lang de --def unsorted=y artwork=y subtitles=de --def extras=y excludeList=".excludes" clean=y --def ignore="Featurettes" --def net.filebot.xattr.store=.xattr ut_dir="$ARG_PATH" ut_kind="multi" ut_title="$ARG_NAME" ut_label="$ARG_LABEL" --def @/home/nzbget/.filebot/args_no_folder.txt
no extra cleaner. ;)

But thank you I will try to modify the post-processing script to catch the errors.
Post Reply