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

Forum Discussion

xiaorrulez's avatar
xiaorrulez
Aspirant
Jul 04, 2012

Startup scripts, where to put them?

Hi guys, just got my new Ultra 6 Plus a few days back. Installed many cool things and slowly migrating data from 5 loose drives onto the NAS. Loving every second!
*I don't do Linux much.

Just installed Sabnzbd+ and Headphones. Two questions:
1) Is there a way to make Sabnzbd+ create downloaded files as owner:nobody and full access? (I know I can tell Sabnzbd to set permissions to 777 once finished downloading)

2) How do I get both of them to start on startup of my ReadyNAS? (As I don't have it on 24/7)
Things I've done/tried already:
- Created a start/stop script in /etc/init.d/ (Which works when called form SSH)
- Created a link to it named "S05sabnzbd" in /etc/rc3.d/ (This is supposed to start it on start up?) I used ln -s ... ...
- Made sure both link and script in init.d had permission to execute (chmod +x?)
- Tried renaming link to "S99sabznbd"
- Tried creating the link in rc5.d instead

It does work when I call it manually, but just does not load on startup? What am I doing wrong?

Thanks

5 Replies

Replies have been turned off for this discussion
  • Hi there!

    First of all, I do not know if this is right board of forums here for my questions, so if it is must not be here - please move it in right place. Thank you in advance!

    I faced a problem in my tries to setup one script to be executed at every boot.

    Let me explain: I am working at one factory, where the DB backup is ~30GB. We are using two devices - NV+ and Duo. It is done every day at 2~3.00 AM and ReadyNas Duo is set to copy backup file after 3.00 AM once a day, which is done approximately around 5~6.00 AM (our network is 100 Mb and is disabled aggresive mode with MTU 1492). Disc capacity of Duo is ~450GB, so after 12-13 copied backups, I am receiving email for disk usage warning. If I didn't take action, after 14-th file there is not possibility to save data, and files are broken. My target is to save last 7 backups - there is no option for this in FrontView - if I am wrong, please, correct me. So my solution was to create script, which make this, what I want and I am starting it via SSH every time, when I received a disk warning email.

    Last three days I have tried to install the file as a service (without breaking loop) - in /etc/init.d and after that to execute update-rc.d command:


    update-rc.d /etc/init.d/dUADB start 90 2 3 4 5 . stop 90 0 1 6 .


    dUADB file:

    #!/bin/bash

    declare i daysSave=7;
    declare i cnt=0;

    for ((;;))
    do

    for file in `ls -t /c/AtlasDB_bkp/*`;
    do
    if [ $cnt -lt $daysSave ];
    then
    echo $file;
    else
    rm $file;
    fi

    let '++cnt';
    done

    break;
    sleep 3600;

    done


    In both of tries, the system have failed (after restart, only power button was blinking) and was necessary to being reinstalled OS or factory default-ed the device. :)

    Is there something wrong in my steps, in my script?

    Best Regards
    GR

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