Shirt Pocket Discussions

Shirt Pocket Discussions (http://www.shirt-pocket.com/forums/index.php)
-   General (http://www.shirt-pocket.com/forums/forumdisplay.php?f=6)
-   -   How do I create a shell script to log out? (http://www.shirt-pocket.com/forums/showthread.php?t=4190)

ben428 06-13-2008 09:09 PM

How do I create a shell script to log out?
 
Hello,

I'd like Superduper to log out the current user when it finishes, rather than shutting down the computer or any of the other available options. It seems like it should be relatively straightforward to create a "shell script" to do this and run it at the end of the backup under "Advanced." But I don't know anything about shell scripts. I do have some experience with Applescript, and tried to run an Applescript at the end of the backup, but got a "permission denied" error.

Can anyone help or point me to a resource on creating shell scripts that will work with SD?

Thanks

Ben

dnanian 06-13-2008 11:02 PM

Well, you could save your script as a compiled script, and then create a shell script that says:

Code:

#!/bin/sh
nohup /bin/bash -c "sleep 30; osascript path-to-your-script" &


ben428 06-14-2008 08:38 AM

Quote:

Originally Posted by dnanian (Post 19815)
Well, you could save your script as a compiled script, and then create a shell script that says:

Code:

#!/bin/sh
nohup /bin/bash -c "sleep 30; osascript path-to-your-script" &


Thanks. Can you be a little more specific about how to create and save the shell script? Does it need to be named in a particular way? Do I need to save it in a particular place?

Ben

dnanian 06-14-2008 08:53 AM

I'm trying not to do that, Ben, because I don't want to "do it all for you"... because then you won't really learn anything. (There are other threads on the forum that show how to do this kind of thing, and how to set permissions properly -- and there are also good resources on the web that explain what shell scripts are, and how they work.)

ben428 06-14-2008 09:30 AM

Quote:

Originally Posted by dnanian (Post 19819)
I'm trying not to do that, Ben, because I don't want to "do it all for you"... because then you won't really learn anything. (There are other threads on the forum that show how to do this kind of thing, and how to set permissions properly -- and there are also good resources on the web that explain what shell scripts are, and how they work.)

Dave, before posting I spent quite a bit of time on the forum and elsewhere on the web trying to find an explanation of how to do this kind of this, and didn't find it -- that doesn't mean it isn't there, but the Internet is a big place. As I said in my original post, I'd be happy to have you point me to a good resource rather than laying it out for me.

dnanian 06-14-2008 09:35 AM

There's a thread right at the top of this forums that includes a shell script. It's a good example...


All times are GMT -4. The time now is 11:33 PM.

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