Using at utility on 10.8.2 not working

I am a beginner, trying to get basic background utilities like at and cron to work on mac os x.

I am typing the following at the prompt:

at now + 1 minute
open -a textedit
^D

nothing happens at the appointed time.

What to change?

start with EXACTLY as it is in the example

at now <<!
cd /home/mydirectory
ls -ltr > /tmp/my.lis
!

If that fails to create the /tmp/my.lis, you need to start the cron daemon.
Keep working until the above example works.

Two points:
you cannot use any interactive program like an editor or one that creates a window like a web browser.

Post back here if you have trouble.

The <<! bit is called a here document. Read up on them so you know what is going on.

I did that, and it still didn't work. When you say "you need to start the cron daemon" do you mean I can't use at and need to use cron or that at relies on the cron daemon?

If so, what is a good way to start cron? classic crontab -e and enter some jobs? I'm working with a classic unix book, and thus far have found everything to work through the bash terminal in a pretty predictable way, until now. I know that Apple built a bunch of tools on top of the basic unix and that laucnhd has taken the place of cron and other traditional daemons - is that what we are dealing with here?

In what way did it "didn't work"? Did it print any messages or anything?

at is disabled in OS X. You can enable at with the following command ->

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

and disable at with ->

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.atrun.plist
1 Like

Thanks. That's what I needed. I assume cron can be cryogenically unfrozen in a similar way.

In earlier versions of OS X cron is working. You just need to create a crontab. You can test if cron is running with

sudo launchctl list | grep 'cron'
#output
379	-	com.vix.cron

one last question: how do I reset the job count? atrm removes them fine, but how do I reset the jobs count for a new job?