Page 1 of 1

what's wrong in this script ?

Posted: January 7th, 2009, 12:32 pm
by zoobidoo
hi guys !
i'm just a beginner with linux scrpting and bash and so on but i've wrote i little scprit to move my downloads from my download folder to another one...



===================

#!/bin/sh

ORIG=/share/Qdownload/sabnzbd/complete/Series
DEST=/share/Qmultimedia/Incoming/Series
cd $ORIG
for f in `find . -type d|grep "^.\/"`; do
        mv $f $DEST
done

==================


i'm running sabnzbd 0.4.5 on my nas (qnap 209 pro2). The problem is when the download is completed (download, repair via par2 and extraction) my script is supposed to move thes files to another folder. But instead i'm receving this prompt :

/share/Qdownload/sabnzbd/scripts/series.sh: line 8: find: command not found


obviously it doesn't seems to work

what's weird is when i lauch the script manually via a ssh session everything is just perfect.

any idea why it's not working via the script command in sab ?

thx to contributers !

Re: what's wrong in this script ?

Posted: January 7th, 2009, 12:44 pm
by rAf
Hi zoobidoo,

Try to chmod+x /share/Qdownload/sabnzbd/scripts/series.sh, it should work

Re: what's wrong in this script ?

Posted: January 7th, 2009, 1:41 pm
by zoobidoo
that was a fast answer ! thx
unfortunately it only change the problem : now i have an other issue :

/share/Qdownload/sabnzbd/scripts/series.sh: line 8: /usr/bin/find: No such file or directory


maybe another idea ?
thank you again !

Re: what's wrong in this script ?

Posted: January 7th, 2009, 2:57 pm
by switch
I'm not sure of a solution, but if I remember correctly SABnzbd on QNAP is built to run under chroot which may not have access to /usr/bin/find

Re: what's wrong in this script ?

Posted: January 7th, 2009, 4:36 pm
by zoobidoo
thank you again
i'm not sure to understand what it really mean =)
so i'm also asking the same topic on qnap's forum