Bacula-users

[Bacula-users] Wake-on-LAN and bacula

2013-09-05 19:22:16
Subject: [Bacula-users] Wake-on-LAN and bacula
From: Steve Ellis <ellis AT brouhaha DOT com>
To: Bacula Users Mailing List <bacula-users AT lists.sourceforge DOT net>
Date: Thu, 5 Sep 2013 16:17:18 -0700
My bacula installation supports night-time backups of several Windows machines (win7 and xp) that are typically suspended when the backups start from a Linux-based server.  I made sure to enable Wake-on-LAN on all of the windows clients, and arranged a script to wake them, but Windows often believes that the machine is idle during a backup and the machines used to go down during a backup.

I updated my python script to run a daemon process for each machine to keep them awake during backup, it is relatively short so I'm including it here, on the off-chance that it proves helpful to anyone--I'm happy to answer any questions about it.  It is dependent on a library daemon.py (note: not the pending daemon PEP), that I downloaded here: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python , but I believe this github implementation would also probably work: https://github.com/stackd/daemon-py

Note that the script does require your host->MAC address mapping, since the machines may be down, you can't just ARP for them  (I use a python dictionary, but this could be extended to a db for those with larger sites--especially if you already track MAC addresses).  To make a Windows machine do WoL, you likely will have to both configure WoL in the BIOS and also make a config change in windows on the LAN interface to enable WoL.

Here's how I use my script in my bacula-dir.conf:
RunBeforeJob = "/etc/bacula/wake_up.py --daemon start %c"
RunAfterJob = "/etc/bacula/wake_up.py --daemon stop %c"

I don't recall if this assumes that the hostname and the client name are the same, I suspect it does.

-se

--

They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.

                               --Benjamin Franklin, 1759

Attachment: wake_up.py
Description: Binary data

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
<Prev in Thread] Current Thread [Next in Thread>