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

Go Back   Shirt Pocket Discussions > SuperDuper! > General
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #16  
Old 01-12-2007, 10:38 PM
shorton shorton is offline
Registered User
 
Join Date: May 2005
Location: NH, USA
Posts: 16
Script Help

Here is what I have in a terminal window.

Last login: Fri Jan 12 22:31:33 on ttyp1
Welcome to Darwin!
SBC-Sanctuary:~ root# cat /private/var/root/Desktop/restartshellscript.txt
SBC-Sanctuary:~ root# cat /private/var/root/Desktop/restartshellscript.txt
SBC-Sanctuary:~ root# ls -l /private/var/root/Destktop/restartshellscript.txt
ls: /private/var/root/Destktop/restartshellscript.txt: No such file or directory
SBC-Sanctuary:~ root#
Reply With Quote
  #17  
Old 01-13-2007, 09:11 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... that certainly implies that the file isn't where you indicated it was, isn't named that, etc... do an

ls -l ~/Desktop

to see what it's really called.
__________________
--Dave Nanian
Reply With Quote
  #18  
Old 01-15-2007, 09:51 PM
shorton shorton is offline
Registered User
 
Join Date: May 2005
Location: NH, USA
Posts: 16
Script Help

Last login: Mon Jan 15 21:46:47 on console
Welcome to Darwin!
SBC-Sanctuary:~ root# ls -l ~/Desktop
total 2920
-rw------- 1 root wheel 6148 Jan 12 22:32 .DS_Store
-rw------- 1 root wheel 0 Nov 3 2005 .localized
-rwxrwxrwx 1 root wheel 1481534 Mar 18 2006 Take Control of Making Music with GarageBand (3.0).pdf
-rwxr-xr-x 1 root wheel 25 Jan 12 22:21 restartshellscript.txt
SBC-Sanctuary:~ root#
Reply With Quote
  #19  
Old 01-15-2007, 09:53 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
ok, so:

cat ~/Desktop/restartshellscript.txt

should print it out...
__________________
--Dave Nanian
Reply With Quote
  #20  
Old 01-15-2007, 10:14 PM
shorton shorton is offline
Registered User
 
Join Date: May 2005
Location: NH, USA
Posts: 16
Script Help

I have no printer connected to this printer, so after
cat ~/Desktop/restartshellscript.txt and 'return', nothing seems to happen.
Reply With Quote
  #21  
Old 01-15-2007, 10:18 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
No printer needed. If nothing happens, the file is empty.

Let's create this file in Terminal. Note: you cannot make any typing errors here. Type:

Code:
cat >~/Desktop/restart.shell
#!/bin/sh
shutdown -r +1
^D (that is, Control-d, don't type ^D or this text :))
Then:

Code:
chmod +x ~/Desktop/restart.shell
Ok. Now:

Code:
cat ~/Desktop/restart.shell
And that should show the text you typed. Finally:

Code:
~/Desktop/restart.shell
should restart you.
__________________
--Dave Nanian
Reply With Quote
  #22  
Old 01-18-2007, 12:25 AM
shorton shorton is offline
Registered User
 
Join Date: May 2005
Location: NH, USA
Posts: 16
Script Help

Progress has been made, thank you.

Doing what you wrote above I was able to get a shell script to restart the Mac. I then ran SuperDuper with the shell script being executed after completion of the backup script.

Interestingly, the SD window last step said 'script failed to execute' or some similar error message. However, after one minute the machine rebooted, so obviously it did run indeed. Below is that portion of the SD log.

12:18:42 AM | Info | ...ACTION: Running shell script restart.shell
| 12:18:42 AM | Info | ......COMMAND => Invoking After Copy shell script: /private/var/root/Desktop/restart.shell
| 12:18:42 AM | Error | shutdown: [pid 259]

Anyway, I think that what I wish to accomplish will now work, but am curious about the error.

Thank you, Scott
Reply With Quote
  #23  
Old 01-18-2007, 08:16 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 this is because we got a signal that the system is shutting down. There are ways to fix this, e.g:

Code:
#!/bin/sh
nohup /bin/bash -c "sleep 10; shutdown -r +10" &
__________________
--Dave Nanian
Reply With Quote
  #24  
Old 01-18-2007, 08:01 PM
shorton shorton is offline
Registered User
 
Join Date: May 2005
Location: NH, USA
Posts: 16
Script Help

Well, it sounds as if I would have to start over creating the shell script and other than following your recipe, I really don't know what I am doing. However, is there any harm in leaving it the way it is with the error?
Reply With Quote
  #25  
Old 01-18-2007, 08:02 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
Not really...
__________________
--Dave Nanian
Reply With Quote
  #26  
Old 01-18-2007, 08:27 PM
shorton shorton is offline
Registered User
 
Join Date: May 2005
Location: NH, USA
Posts: 16
Script Help

Thank you for your help.

In summary, if I were to re-create the shell script via terminal I would then use the code
-------
#!/bin/sh
nohup /bin/bash -c "sleep 10; shutdown -r +10" &
-------
instead of
-------
cat >~/Desktop/restart.shell
#!/bin/sh
shutdown -r +1
^D
-------
Is this correct?
Reply With Quote
  #27  
Old 01-18-2007, 08:31 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
That's rightish (the code goes in the pace of the

#!/bin/sh
shutdown -r +1

of course, the other parts actually create the file with the code in it).
__________________
--Dave Nanian
Reply With Quote
  #28  
Old 01-21-2007, 07:27 AM
shorton shorton is offline
Registered User
 
Join Date: May 2005
Location: NH, USA
Posts: 16
Script Help

Well, maybe I spoke to soon. There is another level of complexity here, and got the following error on an autoexecution this AM.

| 05:09:32 AM | Info | ...ACTION: Running shell script restartshellscript.txt
| 05:09:32 AM | Info | ......COMMAND => Invoking After Copy shell script: /private/var/root/Desktop/restartshellscript.txt
| 05:09:32 AM | Error | sh: line 1: /private/var/root/Desktop/restartshellscript.txt: No such file or directory

This machine boots up automatically at 4:55AM Sunday mornings to the log-in screen. Because the root account is running SD, the scheduled execution of the backup did run and SD appears behind the log-in window. However, the restart shell script apparantly could not be found and gave the above error.

Would it make any difference if the path to the shell script were in the Shared users directory? Or is this just going to be a problem because of the log-in window screen being where the computer is at? Or would the newly suggested code be better?

TIA, Scott
Reply With Quote
  #29  
Old 01-21-2007, 07:26 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
You can put it anywhere you want (as long as it's readable by root) -- it just has to be in that location, and it doesn't look like it's where you've indicated it is...
__________________
--Dave Nanian
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

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
Booting from backup guruuno General 27 10-16-2009 11:53 PM
Do shell script erroring? Budgie General 1 02-08-2006 04:50 PM
Scheduled Custom Script Uses Wrong Script? Dasman General 1 12-08-2005 01:55 PM
Error: No space left on device tradervic General 11 06-29-2005 04:50 PM
Error when running SuperDuper via shell script kbradnam General 9 03-09-2005 05:12 PM


All times are GMT -4. The time now is 09:58 AM.


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