[plug] Job end notifications

Brad Campbell brad at fnarfbargle.com
Fri Jul 25 12:04:18 UTC 2014


G'day all,

I have a stack of hard drives here I need to secure erase. My workshop 
hack machine has 3 screwless hotswap bays so I'm doing 3 at a time. The 
issue with a secure erase is you start it and hdparm goes off into the 
weeds until its done. The problem is how do you know they are all done 
and ready for a swap?

When you start a secure erase, hdparm blocks in the 'D' state which is 
counted into your loadavg. So an idle machine sits at ~0.1/2 loadavg and 
a machine with 3 hdparms sits at > 3.

By running everything in a screen session I can manage the tasks easily 
and something like this :

while [ "`awk '{print $1}' /proc/loadavg | cut -f1 -d'.'`" -gt 0 ] ; do 
sleep 10 ; echo -n '.' ; done ; echo "It is done "`date` |  mail -s 
"Done" b.campbell at mydomain.com

.. means I get a notification on my iPad and Blackberry as soon as all 
three task are completed. Time to swap the disks and start again. No 
periodic checking required. A "Wife approved" solution.

Thought it interesting enough to post.

Regards,
Brad


More information about the plug mailing list