Shirt Pocket Discussions  
    Home netTunes launchTunes SuperDuper! Buy Now Support Discussions About Shirt Pocket    

Go Back   Shirt Pocket Discussions > SuperDuper! > General

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-10-2007, 04:26 AM
franconi franconi is offline
Registered User
 
Join Date: Oct 2007
Posts: 11
Question Shutdown forced by UPS

Hi,
The following seems a common scenario for may of us.
I have a UPS that forces a shutdown when the current goes off and the UPS battery is low. How does SD behave in this case, if this happens while SD is making the backup? Is the backup copy left in an incomplete but safe (i.e., readable) state, or is the copy screwed up? I am making the backup to a single disk image in a networked NAS disk.
What would be the best way to handle such case?
cheers
--e.
Reply With Quote
  #2  
Old 10-10-2007, 10:04 AM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
Well... it really depends on how the UPS software does the shutdown. If it's a clean shutdown, everything should be safe but incomplete. If it's a "bad" shutdown, nearly anything could happen.
__________________
--Dave Nanian
Reply With Quote
  #3  
Old 10-10-2007, 10:55 AM
franconi franconi is offline
Registered User
 
Join Date: Oct 2007
Posts: 11
Quote:
Originally Posted by dnanian View Post
Well... it really depends on how the UPS software does the shutdown. If it's a clean shutdown, everything should be safe but incomplete. If it's a "bad" shutdown, nearly anything could happen.
Well... http://www.shirt-pocket.com/forums/i...lies/smile.gif
It is a typical Mac built-in forced shutdown: it does not depend on the UPS software, but it is the built-in UPS management software of MacOSX Tiger.
Since 10.4.9, Intel Macs (like mine) have a "shutdown -u" option (see man shutdown), that is actually used for UPS forced shutdowns (see the script /usr/libexec/upsshutdown).

So, given the above info, can you comment whether SD will leave the remote disk image safe (i.e., readable although incomplete) after an UPS shutdown?

cheers
--e.
Reply With Quote
  #4  
Old 10-10-2007, 11:03 AM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
Give what that script does -- force a shutdown -- it's unlikely an image would be unmounted by Finder before power was removed (since it waits for a dirty close).
__________________
--Dave Nanian
Reply With Quote
  #5  
Old 10-10-2007, 11:23 AM
franconi franconi is offline
Registered User
 
Join Date: Oct 2007
Posts: 11
Quote:
Originally Posted by dnanian View Post
Give what that script does -- force a shutdown -- it's unlikely an image would be unmounted by Finder before power was removed (since it waits for a dirty close).
Since we have the possibility to edit/personalise the script in /usr/libexec/upsshutdown, what would you do to manage the whole process properly from the SD point of view, before launching the final shutdown -h?

cheers
--e.
Reply With Quote
  #6  
Old 10-10-2007, 11:26 AM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
Well, I'd probably try to kill SDCopy and unmount the image, if any.
__________________
--Dave Nanian
Reply With Quote
  #7  
Old 10-10-2007, 11:28 AM
franconi franconi is offline
Registered User
 
Join Date: Oct 2007
Posts: 11
Quote:
Originally Posted by dnanian View Post
Well, I'd probably try to kill SDCopy and unmount the image, if any.
kill -9 ? Or a nicer way to kill :-) ?
Reply With Quote
  #8  
Old 10-10-2007, 11:34 AM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
I think a normal kill'll do it, no need to force. Try a SIGTERM or SIGQUIT.
__________________
--Dave Nanian
Reply With Quote
  #9  
Old 10-10-2007, 12:09 PM
franconi franconi is offline
Registered User
 
Join Date: Oct 2007
Posts: 11
Quote:
Originally Posted by dnanian View Post
I think a normal kill'll do it, no need to force. Try a SIGTERM or SIGQUIT.
Indeed! I did a kill -TERM $SDCopy.pid and I could re-mount the incomplete image!

Now, I guess that I should do the same for the fsck, and that at the end I could do a kill of the SuperDuper process itself (parent of both SDCopy and fsck).
Or would it work if I kill directly just SuperDuper?

cheers
--e.
Reply With Quote
  #10  
Old 10-10-2007, 12:11 PM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
Well, the fsck is happening only during the mount (part of the OS), so the image wouldn't be mounted yet if that was running. I wouldn't kill SD! itself -- not really necessary.
__________________
--Dave Nanian
Reply With Quote
  #11  
Old 10-10-2007, 12:41 PM
franconi franconi is offline
Registered User
 
Join Date: Oct 2007
Posts: 11
Thanks.
So, now I have added the following to the upsshutdown script (before the shutdown):

killall -TERM SDCopy
hdiutil detach /Volumes/TheBackupDiskImage
hdiutil detach /Volumes/TheRemoteDisk

Ca you comment which is better between -TERM and -QUIT?
Reply With Quote
  #12  
Old 10-10-2007, 12:55 PM
dnanian's Avatar
dnanian dnanian is offline
Administrator
 
Join Date: Apr 2001
Location: Weston, MA
Posts: 14,923
Send a message via AIM to dnanian
-TERM should be fine; they're not really better.
__________________
--Dave Nanian
Reply With Quote
  #13  
Old 10-10-2007, 01:17 PM
franconi franconi is offline
Registered User
 
Join Date: Oct 2007
Posts: 11
Thanks for everything. You guys rock!
This is the final version of my addition to the upsshutdown script:

killall -TERM SDCopy
hdiutil detach /Volumes/TheBackupDiskImage
umount /Volumes/TheRemoteDisk
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
When will the next scheduled backup be if copmuter was turned off? macjonte General 26 02-20-2012 12:17 AM
Restart Machine ShosMeister General 8 08-04-2007 11:26 AM
Shutdown option brilor General 3 02-21-2006 12:18 PM
How do you just shutdown Mac after backup NeoHawkeye General 5 08-29-2005 07:25 PM


All times are GMT -4. The time now is 03:35 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.