Page 1 of 1

Help! need a script that creates a file in a defined folder

Posted: August 2nd, 2011, 5:07 pm
by Derbyboy
I need a post-processing script that creates a file when download is finished. I´m gonna use that file to trigger an action in Eventghost/Directory Watcher. As is is now all the rars triggers actions and I just want one action.

Pls Help

Thanks

/D

Re: Help! need a script that creates a file in a defined fol

Posted: August 2nd, 2011, 5:11 pm
by shypike
@echo off
Echo aktie >d:\pad\naar\mijn\file

Re: Help! need a script that creates a file in a defined fol

Posted: August 2nd, 2011, 5:35 pm
by Derbyboy
Thanks alot

Sorry I´m really new at his.

Is it just to save the script with the extension .sh for example aktie.sh and then point sabnzbd to correct folder (the Post-Processing Scripts Folder)?

And of course change the path (d:\pad\naar\mijn\file).

Tanks

Re: Help! need a script that creates a file in a defined fol

Posted: August 3rd, 2011, 12:41 am
by shypike
For Linux, the script will different.
After saving to a file you also need to set the X bit.
chmod +x filepath

Your script would be:
#!/bin/sh
echo action >/path/to/file

Re: Help! need a script that creates a file in a defined fol

Posted: August 3rd, 2011, 4:58 am
by Derbyboy
But i use Windows, should I ide the first code you provided then and save as for example aktion.sh?

Thanks for your time

Re: Help! need a script that creates a file in a defined fol

Posted: August 3rd, 2011, 9:49 am
by shypike
On Windows scripts have a .cmd extension.