NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.

Forum Discussion

PatrikL's avatar
PatrikL
Aspirant
Oct 12, 2011

Not getting cron to work

I've tried to get a script (importing torrent files from rss) executed once an hour by simply placing it in cron.hourly but nothing whatsoever happens. The script executes well manually when I'm logged in as root and the file permissions are set to exactly the same as the files in cron.daily (since there were none in cron.hourly) but doesnt seem to run. Or does and I havent found the log that says that something went wrong?

Yesterday I moved it to cron.daily to see if that works better but no luck...

Any idea to what I am doing wrong? Do I need to register my script file somewhere as well as putting it into one of the cron directories?

Cheers

Edit: This is on a ReadyNas Ultra 2, bought a few weeks ago and updated to the latest firmware since then

25 Replies

Replies have been turned off for this discussion
  • Thanks for the suggestion Stefan but with last nights update to Transmission it seems to be working for me again. A whole night without a crash now :P Any advantages to using ruTorrent instead? The only thing which isnt perfect now it that I have to manually remove torrents which have stopped seeding (after a few hundred percent)

    I also got the cron'd script to work properly. I can't be 100% sure what the issue with additional script file I added was but I think it was permission related. Either that or the fact that it is no longer named .sh in the end (that really should make a difference should it?)
  • Since Transmission is now working for you I guess there is no real benefit in using ruTorrent. The only reason I asked is that you said you had problems with Transmission - and maybe the fact that I could use some more people testing ruTorrent ;)

    -Stefan
  • WhoCares? wrote:
    Since Transmission is now working for you I guess there is no real benefit in using ruTorrent. The only reason I asked is that you said you had problems with Transmission - and maybe the fact that I could use some more people testing ruTorrent ;)

    -Stefan


    Drop me a PM Stefan, I'll give it a try for you. I need to get a few ISO's up to date...
  • Hi there, I'm digging back the thread.

    I've install foscam cams at home and in my garage, and the foscam software doesn't include video recording...

    I've looked about everywhere to have something working on my NAS (without paying the hundreds dollars for ReadyNAS surveillance, which seems to suck...), and i've found a thread where someone managed to get a cron job associated to the curl command to record the video stream of the cams, in 5 minutes timestamped videofiles.

    After few tweaks, i managed to make it work perfectly with my NAS, except one component : the cron job. It doesn't manage to run anything...

    I've tested the script, everything works, but i feel like i've tested any cron configuration possible, but it never works (neither the cron job to launch skifta at startup).

    Is there a special thing to do to have cron working with my ultra, or am i just that bad with linux ?


    Edit :
    Just forgot :

    My script which works "perfectly" (even launched via /bin/sh) : recordfoscam.sh (located in /opt/)

    DOSS1="/c/Foscam/appart/"
    NEW_NAME="appart"$(date +%d)"."$(date +%m)"."$(date +%y)"-hour"$(date +%H)"-"$(date +%M)".avi"
    nohup curl -s -m 295 -o $DOSS1$NEW_NAME http://user:pass@192.168.0.71:XXXX/videostream.asf & sleep 1

    DOSS2="/c/Foscam/garage/"
    NEW_SAME="garage"$(date +%d)"."$(date +%m)"."$(date +%y)"-hour"$(date +%H)"-"$(date +%M)".avi"
    nohup curl -s -m 295 -o $DOSS2$NEW_SAME http://user:pass@192.168.0.72:XXXX/videostream.asf & sleep 1


    Note : The variable with the folder name is created bacause when running with /bin/sh, it seemed like the end of the command was scratched


    I've then added, with crontab -e, and a file in cron.d :

    # record of webcams
    */5 * * * * root /opt/recordfoscam.sh
  • Damn, i just solved my problem, i just didn't realise that cron doesn't know ANY path...

    I just had to point directly to all the functions i'm using :
    /usr/local/bin/curl instead of curl
    when necessary : /usr/bin/nohup instead of nohup
    /usr/bin/java instead of java

    Just did that, it now works.

NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology! 

Join Us!

ProSupport for Business

Comprehensive support plans for maximum network uptime and business peace of mind.

 

Learn More