run scripts at login/wake and sleep/shutdown

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

  1. macrumors newbie

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

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

    grapes911

    Joined:
    Jul 28, 2003
    Location:
    Citizens Bank Park
    #2
  3. thread starter macrumors newbie

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

Share This Page