Page 1 of 1

auto shutdown

PostPosted: Thu Jun 07, 2012 12:26 pm
by fraumo
Hi
When I use lacie interface there was a menu to alow to disconect the nas at the time I want

There is something similar in this new version 12.0??

thanks for your help

Re: auto shutdown

PostPosted: Thu Jun 07, 2012 5:18 pm
by Jocko
Currently, this feature is not directly present in this version. :dry

But there is a solution using cron. :)
Attached a small script that stops the server and the NAS waits to receive a WOL magic packet. To re-enable the NAS, you just have to send a WOL from your PC.
=> LaCie Network Assistant can do it but you can use another, simply enter the MAC address of the NAS.
=> So, you must save first the MAC address in your PC! (you could forget it)
The MAC address is visible in the menus "Information" and "Restart"

(Note : if you forget the MAC address, unplug the power cable and plug again. So, the NAS will boot fully)

Installation:
Save the tar file in the share fvdw.
In the upload menu, put in the field "wol_sleep.tar" (without quote) and in the second field "untar" (also without quote) and click on Accept.

To plan the stop, do in the cron menu :
Enable Cron at each boot(checkbox) and Accept
Click "Add new job"
Chose the date and hour (but you can also schedule it to do this job regularly)
Put in the field "job":
Code: Select all
/usr/bin/php -f /usr/sbin/wol-sleep.php

Put a comment
click "generate job line"
and click "Accept"

Note1: it's not a real stop (just don't start the firmware and spin down the disk).
Note2 : with this cron version, you can not schedule a boot.

But you give me the idea to add in the server menus (FTP, NFS, MEDIA) some options to schedule the stop and start of these servers. :thinking

Re: auto shutdown

PostPosted: Fri Jun 08, 2012 8:44 am
by fraumo
Work fine

You are the man

Thanks

Re: auto shutdown

PostPosted: Sat Oct 06, 2012 6:46 am
by matzi
I tried a new festures (FW 13) in cron menu, the NAS Stanby WOL function.

But the CRON logfile says:
Code: Select all
crond: USER root pid 6096 cmd /usr/sbin/wol-sleep.php
/usr/sbin/wol-sleep.php: line 1: can't open ?php: no such file
/usr/sbin/wol-sleep.php: line 2: syntax error: unexpected word (expecting ")")



What can be wrong?

Re: auto shutdown

PostPosted: Sat Oct 06, 2012 9:38 am
by Jocko
Hi matzi,

Sorry for this, it's a bug. :twak

The command "/usr/sbin/wol-sleep.php" can not directly be performed. The correct command is :
/usr/bin/php -f /usr/sbin/wol-sleep.php.

(I didn't check this job when I included it in the new menu... :whistle ).

So I go to post a patch to fix it.

Re: auto shutdown

PostPosted: Sat Oct 06, 2012 2:17 pm
by matzi
OK with the manual command it works.But it switches to standby even when I have open files under access can I avoid that with a script?

Re: auto shutdown

PostPosted: Sat Oct 06, 2012 2:44 pm
by Jocko
Humm

Yes with samba access we can detect this(smbstatus command) but not with the other accesses (NFS...)

So we can change the script with a loop that checks if no samba process is running. If some samba process are running, the script will wait for 15 min, otherwise make standby the NAS