pavement

At

From FreeBSDwiki
(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
The '''at''' scheduler is used to schedule a job for one-time-only running at a later date.  For comparison, the [[cron]] scheduler is used to schedule jobs for repeated execution at regular intervals.  One very handy use of the '''at''' scheduler is to schedule lengthy jobs to run in the background immediately - that way even if you need to (or are forced to) close your [[shell]] session, your job will continue running.  You could force a job to the background without using '''at''' simply by adding an ampersand to the end of your command line - for example '''cvsup /usr/share/examples/cvsup/ports-supfile &''' - but if forced to the background that way, it is still a [[child process]] of your shell, and thus will die a sudden death if you choose to log out before it is done.
+
The '''at''' scheduler is used to schedule a job for one-time-only running at a later date.  For comparison, the [[cron]] scheduler is used to schedule jobs for repeated execution at regular intervals.  One very handy use of the '''at''' scheduler is to schedule lengthy jobs to run in the background immediately - that way even if you need to (or are forced to) close your [[shell]] session, your job will continue running.  For example:
 +
 
 +
'''ph34r#''' at now
 +
cvsup /usr/share/examples/cvsup/ports-supfile
 +
''<nowiki>[user presses Control-D, aka the [[eof]] character, to indicate interactive job adding is done]</nowiki>''
 +
Job 3 will be executed using /bin/sh
 +
'''ph34r#'''
 +
 
 +
You can force a job started from the shell into the background without using '''at''' simply by adding an ampersand to the end of your command line - for example:
 +
 
 +
'''ph34r#''' cvsup /usr/share/examples/cvsup/ports-supfile &
 +
 
 +
However, if started that way the job is still a [[child process]] of your shell, and thus will die a sudden death if you choose to log out before it is done.
  
 
Access to either [[cron]] or the '''at''' scheduler may be open to all users or restricted only to certain users at the system administrator's discretion.
 
Access to either [[cron]] or the '''at''' scheduler may be open to all users or restricted only to certain users at the system administrator's discretion.

Revision as of 13:03, 25 August 2004

The at scheduler is used to schedule a job for one-time-only running at a later date. For comparison, the cron scheduler is used to schedule jobs for repeated execution at regular intervals. One very handy use of the at scheduler is to schedule lengthy jobs to run in the background immediately - that way even if you need to (or are forced to) close your shell session, your job will continue running. For example:

ph34r# at now
cvsup /usr/share/examples/cvsup/ports-supfile
[user presses Control-D, aka the [[eof]] character, to indicate interactive job adding is done]
Job 3 will be executed using /bin/sh
ph34r#

You can force a job started from the shell into the background without using at simply by adding an ampersand to the end of your command line - for example:

ph34r# cvsup /usr/share/examples/cvsup/ports-supfile &

However, if started that way the job is still a child process of your shell, and thus will die a sudden death if you choose to log out before it is done.

Access to either cron or the at scheduler may be open to all users or restricted only to certain users at the system administrator's discretion.

Personal tools