Using at
Your use of at displayed correctly. The command will be executed in 2 minutes in the future. The command is not executed repeatedly, so the file is not affected at any time, except for the time that now + 2 minutes is evaluating.
If you are having trouble getting the at command to run commands, make sure that the atrun start agent is activated and running. See man atrun for details .
Better execution of planned teams
If you just want to do something when you log in, then system settings> Users> Login items are preferred. Rename shell scripts with .command as an extension, but if you do. I'm not sure if this is required, but this is what the OS prefers for such scripts.
Otherwise, try cron to provide more control over the job or use launchd , the mac launch daemon (see man launchd and man launchctl ). Read this blog post , which seems to be a good introduction to using the OS X startup control daemon.
Launchd is the preferred way to schedule commands on mac, here I mention only cron , as this might be more familiar if you come from the Linux background. Take a look at this answer for more information on this.
source share