Differences between crontab and at

Differences between crontab and at

Post by John Switz » Sat, 19 Oct 1996 04:00:00



I've been trying to figure out the differences between crontab and at, and
I've come up with the following. Are these accurate and is there anything
I'm missing? Thanks much.

1. at is a one-shot scheduler - you schedule a job to be run at one time only.
(you can have scripts reschedule themselves automatically, but this is
"invisible" - there's no way to easily find out the scripts that do this).

crontab is a regular scheduler - you can schedule a job to be run at almost
any interval.

2. at makes a copy of your script as it exists when scheduled; if you change
your script after scheduling, you have to delete the previous job and
reschedule to get your modified script in the queue.

crontab runs the command line you specify, so if you modify your script
after scheduling a job, the modified script is automatically run.

3. at can run only scripts without any command line arguments.

crontab can almost anything that's run at the command line.

4. at cannot easily receive input from STDIN

crontab can pass information to scripts from STDIN

5. at makes a copy of most of your environment as it exists when scheduled.

crontab specifies a minimal environment, and if your scripts need more than
that, they have to supply it themselves.

6. at uses the 'a' queue by default, but you can specify another queue. The
'a' queue by default is limited to four simultaneous jobs.

crontab uses the 'c' queue always. The 'c' queue is not limited to any
number of simultaneous jobs by default, although cron can handle a
max of 100 simultaneous jobs among all queues.

7. at allows you to specify which shell you want to run your scripts.

crontab uses the Bourne shell (/bin/sh) always.

8. at jobs are scheduled one at a time. Scheduling one job does not affect
any other previously scheduled jobs.

crontab loads the entire list of scheduled jobs for your user ID. If you
*this up, you can*up all of other scheduled jobs.
--
John Switzer            | "Scooby Doo, pronouncing Windex"
                        |  - index entry for "rindex" in the book
                        |  "Learning Perl" by Randal L. Schwartz,

 
 
 

1. RH difference between /etc/crontab and crontab -e

Why does RH have an /etc/crontab file? Is this the preferred way to
spawn cronjobs? What about crontab -e? When is this preferred? Is it
just a matter of defining specific environment variables for each
cron?

I have run into situations using expect scripts in cron, where a
reboot was necessary to get the jobs to run. Any idea what I might
have been doing wrong?

thanks in advance,
Erich Trowbridge

2. internet games hosting

3. HELP - crontab vs. interactive differences

4. Linux + ncsa extremely slow

5. Matrox Mystique ands X.

6. RedHat 5.0 and ATAPI Zip drive

7. crontab problem: I can't run a java program via crontab

8. I had to reboot...

9. crontab -e or crontab -l is not functioning properly

10. crontab entries generate error message; problem with ownership of crontab file?

11. To crontab or NOT to crontab!!!

12. fix to crontab problem ("no changes made to crontab")

13. link a crontab -> "crontab -e" remove link