Post Script Cant script created file to completed folder.

Come up with a useful post-processing script? Share it here!
Post Reply
conguero23
Newbie
Newbie
Posts: 2
Joined: September 4th, 2018, 2:42 pm

Post Script Cant script created file to completed folder.

Post by conguero23 »

I have a simple script where I want to create a file with some info once the file is completed downloading. The issue is it wont write the file and also no error occurs. If I write a folder name of a file that was downloaded previously it works but not the current folder that just downloaded.

import sys, os
folder_name = sys.argv[1]
os.chmod(folder_name, 0o444)
full_path = os.path.join(folder_name, 'myfile.nfo')
f = open(full_path, "w")
sys.exit(0)

Thanks in advance.
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Post Script Cant script created file to completed folder.

Post by safihre »

Try to debug by adding print statements. For example of your full_path variable.
This also helps to see if the script gets called correctlty.
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
conguero23
Newbie
Newbie
Posts: 2
Joined: September 4th, 2018, 2:42 pm

Re: Post Script Cant script created file to completed folder.

Post by conguero23 »

Thanks I figured it out. Sab was automatically deleting the file once it was created. I eliminated the extension from the cleanup list and now it works.
User avatar
safihre
Administrator
Administrator
Posts: 5338
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Post Script Cant script created file to completed folder.

Post by safihre »

Heheh, good boy Sab doing what it was told :p
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
Post Reply