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

Forum Discussion

Hombibi's avatar
Hombibi
Guide
Sep 05, 2015
Solved

How to send a shutdown command to readynas after backup complete.

After a (succesfull) recovery when two HDD's broke down at the same moment I am reconsidering my backup strategy.

I have a 6 bay Readnas Pro, running OS6, volumes setup JBOD,  as my main NAS, and a 4 bay NV+ V1 as backup machine. Also JBOD.

 

After initial backup via NFS I now backup daily with rsync to a NV+. Both NAS' power on at the same time, after which the backup starts. The Pro remains on during the day, the NV+ shuts down on the power timer after three hours.

 

I let the Pro push to the NV+ given that the Pro has the most cpu capacity. I have GB network, GB switches and the NAS' have GB ports, while the NV+ is optimised for transfer speed. During such rsync backups the NV+ is maxed out (cpu), and transfer speed is some 5 MB/s, if I am correct this is the expected speed from rsync on the NV+ V1

 

As the number and size of files to sync is unpredictable I would like to have the shutdown of the NV+ be determined by the duration of the backup instead of by a timer.

 

One approach would be to have the NV+ "pull" the backups from the Pro, but I am not sure if the NV+ will stay on during a backup regardless of the power off times. Another thing I am not sure of is what the impact on the throughput will be, given that the NV+ is already maxed out even though  the Pro does all the sync calculation work.

 

Another would be to control the NV+ from the Pro: Somehow I would like the Pro to send a shutdown message to the NV+ once the backups are complete. As this is my preferred solution, would anyone have a good idea or solution on how I can control shutdown on a NV+ V1 from the Pro after a backup queue completed?

 

  • I haven't used an NV for a long time, but the x86 OS 4.2.x and OS6 all delay a power-off when a backup is in progress, and I suspect OS 4.1.x on an NV will as well.  That's how I do my backups.  The backup system powers up and initiates the backup.  The power off time is scheduled for 15 minutes after power-on, but the unit stays on until the backup is complete if it takes longer than that.  Note that power down is also delayed for any scheduled maintenance activities (disk scrupping and file consistenacy checks).

7 Replies

Replies have been turned off for this discussion
  • StephenB's avatar
    StephenB
    Guru - Experienced User

    I don't think throughput changes if you change from "push" to "pull".  The source server (e.g. the Pro) is doing the sync computations in either case.   I use "pull" backup everywhere.

     

    I also use the NV+ for backup, and my approach is simply to have spindown enabled on the NV+.  At least half the power use of the NV+ is disk related. So you could set things up so the disks will spin down shortly after backup completes, and the NV+ shutdown remains conservatively set at the 3 hour mark.  

     

    Though you can send a shutdown command to the NV+.  You install curl on the pro.  There are some commands posted here: https://gist.github.com/denwilliams/9701993 (not sure if they work).  There's some older documention that was on the Readynas forum but it isn't easily searchable here.  One challenge is that if you have multiple backup jobs you want to make sure they have all completed.

    • Hombibi's avatar
      Hombibi
      Guide

      Thanks Stephen, made some progress on the remote shutdown call after your message:

       

      First the curl option:

      curl -d "PAGE=System&OUTER_TAB=tab_shutdown&INNER_TAB=NONE&shutdown_option1=1&command=poweroff&OPERATION=set" -k -u admin:<password> https://<IP Backup Machine/get_handler

      This works fine to shut down the NV+, but it is the wrong shut down command. Using this will prevent the NV+ to be started with the powertimer.

       

      However searching on I found that the shutdown string used by the powertimer is:

      /frontview/bin/autopoweroff &> /dev/null

      which I can call remote using SSH:

      ssh root@NV+ 'bash -s' < ./Local Script on the Pro to be executed on the NV+.sh

      This works from my desktop, so it should work from the Pro, but I need to get around the password, maybe something with exchanging keys?. Next is to detect when the backup queue has finished, which is a cron job, and use that to trigger the remote shutdown.

       

      Anyone ideas/suggestions?

      • Sandshark's avatar
        Sandshark
        Sensei - Experienced User

        I haven't used an NV for a long time, but the x86 OS 4.2.x and OS6 all delay a power-off when a backup is in progress, and I suspect OS 4.1.x on an NV will as well.  That's how I do my backups.  The backup system powers up and initiates the backup.  The power off time is scheduled for 15 minutes after power-on, but the unit stays on until the backup is complete if it takes longer than that.  Note that power down is also delayed for any scheduled maintenance activities (disk scrupping and file consistenacy checks).

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