Using the at command is a bit different than using the standard command. When you use at it will be done from the at prompt to schedule an event. Also understanding how at deals with time is imperative. So let's first examine time.
There are a number of ways you can schedule a timed event. You can use the exact time of day, you can use now + time increment, you can use day of the month + time of the day. Say, for instance, it is currently 1pm, and you want to schedule a task for 2pm that same day. You could either use: 2pm, now +60 minutes, or now +1 hour. Or say it is December 5 and you need to run a command (or application) on December 12. For that you could use december 12, now +7 days, or now +1 week.
Now that you have a basic understanding of time, let's take a look at how the at command is used. Let's schedule a print job to occur an hour from the current time. We'll use the lp print command to print the file test.doc. The first thing to do is to issue the at command with the time necessary.The command is entered in a terminal window (such as aterm or eterm). After you enter the first line hit enter.
at now +1 hour
Your prompt will now look like:
warning: commands will be executed using (in order) a) $SHELL b) login shell c) /bin/sh
at>
At this point you will enter the command like so:
at> lp test.doc
When you hit enter you will see:
at>
Now hit the keys "Ctrl" and "d" at the same time to reveal output that looks similar to:
job 12 at 2008-12-05 14:24
You now have a job in the at queue. To check this you can issue the atq command which will print out the at queue. This will only print out job numbers. As you can see, in the sample text above, the job you just created is number 12. If you want to remove the job from the queue you can issue atrm which will remove all jobs from the at queue. If you want to remove only a specific job from the queue you would first find out the job number with the atq command and then issue atrm with the job number as an argument.
Another nice feature of at is the ability to mail to yourself the output of the command. For this you would use the -m argument. To get more output in the mail add the -v argument (for verbose). This would alter the initial command like so:
at -m -v now +1 hour
When this email arrives you should see the standard output as if you ran atq as well as the full command issued (atq does not list the actual command.)