Conditional system shutdown

Status
Not open for further replies.

ijv

Cadet
Joined
Nov 21, 2014
Messages
1
Dear reader,

My system, a old socket 939 motherboard with AMD 4400+ (2core) processor and 4GB of DDR2 RAM.
Fitted with multiple disks of 2TB and one 6TB disk, UFS for all disks. Why UFS? See the PS.
Install: FreeNAS-9.2.1.8-RELEASE-x64

To safe money (motivation see PS2), I'd like to turn off the FreeNAS system with a conditional shutdown script. I was abble to implement this python script:
https://bitbucket.org/jgehrcke/freenas-utils/src/default/conditionalshutdown.py
I found it trough this website:
http://blog.graceabundant.com/2012/08/24/automatic-shutdownwake-up-on-freenas/

Since Im not using any form of RAID (and other reasons) I'd like to "backup" my data to a other FreeNAS system using rsync.
For normal use of my server I power on the server with WOL every time I want to use it.
At night Id like to run the rsync jobs (BIOS turns on system every night), during this rsync the script above should not turn off the system. Im planning both rsync client (push) and rsync server (pull) jobs.
So my question is now: can you please help me adapting the script given above (system powering down in 15minutes when no ping answer from given IP list) conditional to the rsync jobs not being run.
In other words, if my system is running the backup, it should not check for the given IP's, when it is done with the backup it should start looking agane and power the system down if no client is on.
I tried googling for some hooks/triggers or something for rsync starting/finishing but without succes. I have computer and C programming experience, but to linux and python im a (big) noob.

For second backups (or first if you dont see the rsync as a backup). I would like to try one of the nice plugins, bacula-sd? So if the script could also have a condition for not turning on during these backups that would be really great! (else I probbebly use a client system for running scheduled backups).

PS. I tried ZFS2 first on 8*2TB, but had a lot of trouble that I coudn't solve, best prognose of the problem was it had to be the bad implementation of SIL3114 RAID controller on the mainboard (Asus A8N sli deluxe)or a (combination with) UNIX driver for it? Switching between multiple motherboards of same model and switching HD's didnt solve it, eventually ended up with a corrupted ZFS pool (thank science for backups!) Anyway I gave op RAID for a while, but if it is really apreciated I could describe the problem in more detail in appropriate forum topic. I did not post this before because I clearly do not meet the ZFS minimum system requirements (use of RAID controller in JBOD, low memory and no UPS) so I blamed the loss of the pool mainly on myself.

PS2. I did read some posts about this, FreeNAS makes the OS mostly for 24hour use? This is my view on the topic at the moment:
I didn't measure the exact power comsumation of this particular build (will do later). But in the past I did see a system like this easelly consumes 100Watt or maybe 150Watts of power. So lets say 120Watts 24hours on, current kWh price 0,23 euro. 120/1000*0,23*24*365=242euro for 1 year unlimmeted FreeNAS. I really do not use my server that much (for HPTC some admnistration and photo's) so together with the backupping every day I will use it 3 hours every day (really maximum average).
120/1000*0,23*3*365=30euro.
Most of the hardware is really old, I just got it out of waste (old PC of a friend). The only reall value are the hard disks. If the disks die within 3 years from the often turning on and of, I have the warranty (MTBF speciefied for WD red disks, not the amount of spinn ups/spin downs?). After the 3 years I would have saved myself about 600 euro's. That 600 euro's I then rather spend on a new system. I gladly trade this for the downsite: 2minutes waiting every time my server boots.
In future of course cheap systemes will be less power consuming, but also energy prices will stay growing most likely (I doubt there is cheap hardware at this moment thats will beat my 30euro's a year).

So hopefully someone will help me write this script, or in near future maybe FreeNAS will have better built in energy saving options?
 
Last edited:
Status
Not open for further replies.
Top