Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

wrathkeg

macrumors newbie
Original poster
Feb 1, 2010
12
0
Hi,
I have written two simple scripts (one line each) to do some copying (backing up) of files using rsync. It would be nice not to have to remember to do this manually every time. It seems to me that if I could get one of the scripts to run when I log in or the computer wakes up, and the other script runs when I shut down or the computer goes to sleep, that would be great. But I don't really have a clue how to do this. I looked into sleepwatcher, but I saw this in the man pages:

-s sleepcommand, --sleep sleepcommand
Execute sleepcommand when the Mac is put to sleep mode. sleepcommand must not take
longer than 15 seconds because after this timeout the sleep mode is forced by the sys-
tem.

I guess it's possible sometimes the copying of files would take more than 15 seconds, so this seems a no go.

Any suggestions?
Thanks in advance,
wrathkeg
 
thanks for that: i hadn't seen it. if i end up having to come up with, let's say, less streamlined solution i might use that to handle running the script on login.
wrathkeg
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.