Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Is it possible to programmatically trigger the Windows's Hibernate without actually Hibernating, just to take snapshot of the OS at regular intervals? So that the system can return to the previously saved state in case of any failure.

This is much like System Restore, which backups system files; but the idea is to backup the complete OS's active state.

share|improve this question
    
This probably belongs on superuser –  Gary Rowe Mar 6 '11 at 20:08
1  
This isn't a suitable question for Programmers. However, if you could edit it to provide more details it would be easier to migrate it to one of our sister sites where it would find a better home. –  ChrisF Mar 6 '11 at 20:24
1  
@Gary It's about programmatically doing it, so it's probably more suitable for Stack Overflow. –  Maxpm Mar 6 '11 at 22:57
    
@maxpm Yep. For some reason I missed the crux of the question. –  Gary Rowe Mar 6 '11 at 23:45
add comment

closed as off topic by Mark Trapp Dec 17 '11 at 3:41

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers

I don't believe something like that exists, but even if it did, I don't imagine you'd want to use it.

When you hibernate, the kernel freezes all user-mode processes while it takes a snapshot of memory. This can take 10-15 seconds depending on how much memory you have (and therefore how much it has to copy to disk). You don't normally notice this because Windows blanks the screen, but you've probably noticed that the "power" light stays on for a while longer after you hit the "hibernate" button.

So I can't imagine a use-case where freezing everything for 10-15 seconds is really desirable...

share|improve this answer
add comment

No, I have never heard of anything like this. Also, there's (at least) one reason this would be quite tricky to pull off: If you want to save the entire state of the system, you also need to save the state of the harddisk, i.e. take a snapshot of all active partitions (since a file there might presently be open). If done naively, that would be prohibitively expensive. There are ways around this (e.g. FS support for snapshots), but it would be non-trivial.

Note that exactly what you want is already possible in most virtualization software programs; they usually support "snapshots".

share|improve this answer
1  
That's a good point as well. +1 for the virtualization suggestion, I think that's a good idea. –  Dean Harding Mar 6 '11 at 23:22
add comment

VirtualBox has API to create snapshots, and does this quite fast. But 10-15 sec. delays are inevitable.

share|improve this answer
    
You can snapshot using VMware products as well. –  quickly_now Mar 7 '11 at 11:09
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.