Wnr3500Lv2 Tomato Shibby - my script has different behavior in scheduler

2 posts / 0 new
Last post
nbrunaud
nbrunaud's picture
Wnr3500Lv2 Tomato Shibby - my script has different behavior in scheduler

I'm beginner with shell scripting, so maybe I'm missing something very basic... 

My script does work perfectly  in "tools>system commands",  but the "find" command fails in "administration >scheduler"... 

Is there any reason why the behavior is different? Environment?  Why the" find" only, and not the rest? 

 

The code is directly pasted in the scheduler page... 

Here is the full script 

 

if [ -e $runningfile ]  ; then

     echo already running

      # echo already running > $logfile

 else

     echo 1 > $runningfile

     echo "START DOWNLOAD"

     echo "START DOWNLOAD" > $logfile

     ncftpget -DDRv -u $user -p $pass $logTag $host "$dir_local_tmp" "$dir_remote_source"

     if [ "$?" -ne "0" ] ; then 

         echo "ERROR"

         echo "ERROR : $logfile "\n >> $errorlogfile

     else

         echo "SUCCESS MOVE Result but ignore empty folders"

         find "$dir_local_tmp$dir_remote_source" -type d -empty -delete

         mv -f "$dir_local_tmp$dir_remote_source"  "$dir_local_dest"

      fi

     rm  $runningfile

     echo "END"

fi

nbrunaud
nbrunaud's picture
Well, I have finally made it

Well, I have finally made it work.

I added the full path of the command "/opt/bin/find".

Indeed, I understood that the "find" command came with entware like the "ncftpget" ...

But, it's still mysterious, why the "ncftpget" call works and not the "find"...