On 10/01/2010 09:13 AM, Philipp Storz wrote: > Hello list, > > when backing up a windows 7 laptop, I experienced that > on the long running full backup, it started to hibernate > and so it interrupted the backup. > > I thought that maybe there is a mechanism to tell windows > "hey, I am busy making a backup, please do not fall asleep" > > Do you think that this is possible, and would it be a good > enhancement to the file daemon? > > > Best regards, > > Philipp >
The file daemon should use SetThreadExecutionState [1] to enable/disable sleeping during backup. At the moment, however, I'm using an external Python (w/ Cygwin) script to do the same via the ClientRunBeforeJob/ClientRunAfterJob directives (see attached scripts). IMHO this should be integrated into the file daemon. I'm willing to write a patch for this, but I need some pointers (build instructions for 64bit would be a good start - I couldn't find this with a casual search through the manual). Avi [1] http://msdn.microsoft.com/en-us/library/aa373208%28v=vs.85%29.aspx > > > ------------------------------------------------------------------------------ > Start uncovering the many advantages of virtual appliances > and start using them to simplify application deployment and > accelerate your shift to cloud computing. > http://p.sf.net/sfu/novell-sfdev2dev > _______________________________________________ > Bacula-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/bacula-devel >
nosleep.sh
Description: application/shellscript
#! /usr/bin/env python
# Usage: nohup python nosleep.py &
import os
import sys
import signal
import threading
import ctypes
ES_SYSTEM_REQUIRED = 0x00000001
ES_CONTINUOUS = 0x80000000
event = threading.Event()
def ctrlc(signum, frame) :
event.set()
def main():
'''
Prevent system suspend when idle
'''
signal.signal(signal.SIGINT, ctrlc)
kernel32 = ctypes.CDLL('kernel32.dll')
kernel32.SetThreadExecutionState(ctypes.c_int(ES_CONTINUOUS|ES_SYSTEM_REQUIRED))
event.wait()
print 'Bye!'
return 0
if __name__ == '__main__' :
sys.exit(main())
yessleep.sh
Description: application/shellscript
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________ Bacula-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bacula-devel
