On 10/01/2010 02:29 PM, Kern Sibbald wrote:
> Hello,
>
> Thanks for the pointers to the Windows documentation and the sample Python 
> program.  I wasn't aware that this is a problem, but from the Windows 
> documentation, it looks relatively simple to fix (i.e. integrate into the 
> FD).
>   

I've attached an *untested* patch against current git. It should work (TM).

> Building the Windows binaries is done by cross compiling.  It is documented 
> in 
> detail in <bacula>/src/win32/README.mingw   

Read it, and it does look like too much of a hassle at this point.

I should add that an integrated per-client wake-on-lan feature would
also be useful (I'm currently using a RunBeforeJob directive to wakeup
the laptop with sudo+etherwake).

Cheers,
Avi.


> However, it is not easy to setup 
> a complete environment and might possibly take much longer to help you get 
> setup rather than simply implementing it ourselves ...  That said, if you 
> want to try to build it just read the above referrenced instructions -- there 
> are at least 6 people aside from myself who have succeeded in getting it 
> working.
>
> I will ensure that this is put on our list of items to do for the next 
> version.
>
> Thanks again for your pointers.
>
> Kern
>
> On Friday 01 October 2010 14:02:23 Avi Rozen wrote:
>   
>> 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
>>>       
>
>   

diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c
index 368976d..431fd7d 100644
--- a/bacula/src/filed/job.c
+++ b/bacula/src/filed/job.c
@@ -240,6 +240,11 @@ void *handle_client_request(void *dirp)
    const char jobname[12] = "*Director*";
 // saveCWD save_cwd;
 
+#if defined(HAVE_WIN32)
+   /* prevent sleep when idle */
+   SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED);
+#endif
+   
    jcr = new_jcr(sizeof(JCR), filed_free_jcr); /* create JCR */
    jcr->dir_bsock = dir;
    jcr->ff = init_find_files();
@@ -403,6 +408,12 @@ void *handle_client_request(void *dirp)
    Dmsg0(100, "Done with free_jcr\n");
    Dsm_check(1);
    garbage_collect_memory_pool();
+
+#if defined(HAVE_WIN32)
+   /* allow sleep when idle */
+   SetThreadExecutionState(ES_CONTINUOUS);
+#endif
+
    return NULL;
 }
 

Attachment: 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

Reply via email to