auto shutdown

auto shutdown

Postby fraumo » Thu Jun 07, 2012 12:26 pm

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
fraumo
 
Posts: 55
Joined: Mon Sep 26, 2011 11:48 am

Re: auto shutdown

Postby Jocko » Thu Jun 07, 2012 5:18 pm

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
You do not have the required permissions to view the files attached to this post.
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: auto shutdown

Postby fraumo » Fri Jun 08, 2012 8:44 am

Work fine

You are the man

Thanks
fraumo
 
Posts: 55
Joined: Mon Sep 26, 2011 11:48 am

Re: auto shutdown

Postby matzi » Sat Oct 06, 2012 6:46 am

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?
matzi
Donator VIP
Donator VIP
 
Posts: 253
Joined: Wed Jul 06, 2011 8:08 am
Location: Hannover Germany

Re: auto shutdown

Postby Jocko » Sat Oct 06, 2012 9:38 am

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.
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: auto shutdown

Postby matzi » Sat Oct 06, 2012 2:17 pm

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?
matzi
Donator VIP
Donator VIP
 
Posts: 253
Joined: Wed Jul 06, 2011 8:08 am
Location: Hannover Germany

Re: auto shutdown

Postby Jocko » Sat Oct 06, 2012 2:44 pm

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
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France


Return to Lacie Network Space vs2 and max version

Who is online

Users browsing this forum: No registered users and 5 guests