run scripts at login/wake and sleep/shutdown

Discussion in 'Mac Programming' started by wrathkeg, Sep 16, 2010.

  1. wrathkeg macrumors newbie

    Feb 1, 2010
    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:

    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,
  2. grapes911 Moderator emeritus


    Jul 28, 2003
    Citizens Bank Park
  3. wrathkeg thread starter macrumors newbie

    Feb 1, 2010
    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.

Share This Page