-1

I want to run a backup command at a specific time in bash. Only issue is the at command doesn't seem to work. By this I mean it does not run the command at the specific time

I have tried to use the commands posted here.

If the at command doesn't work are there any other suggestions?

I am trying to run a custom command I put in the /bin directory called backup. If it helps I am running OS X 10.10 (Yosemite)

Edit

Found out the issue.

Some reason my command will only work outside a script. Hmm

Community
  • 1
  • 1
iProgram
  • 6,057
  • 9
  • 39
  • 80

2 Answers2

2

Use:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist

From the man atrun:

The atrun utility runs commands queued by at(1). It is invoked periodically by launchd(8) as specified in the com.apple.atrun.plist property list. By default the property list contains the Disabled key set to true, so atrun is never invoked.

Execute the following command as root to enable atrun:

launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist

clt60
  • 62,119
  • 17
  • 107
  • 194
0

Found the reason why. It is because the command for some reason didn't work (it did before though)

iProgram
  • 6,057
  • 9
  • 39
  • 80