At
From FrugalWiki
Dansk – Deutsch – English – Español – Français – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Polski – Português – Română – Slovenský – Suomi – Svenska – Türkçe – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어
Contents |
at
- atd - run jobs queued for later execution — man atd
atd is a daemon which executes the scheduled jobs only once. To communicate with atd its client applications can be used :
- at schedule a job to be executed at given time,
- atq list pending jobs,
- atrm delete jobs,
- batch postpone a job to be executes when system load level permits.
$ at 12:34 <<< ~/script/cleanup.sh
warning: commands will be executed using /bin/sh
job 15 at Tue Jul 26 12:34:00 2011
$ atq
15 Tue Jul 26 12:34:00 2011 a master
$ atrm 15
Note that the command has to be passed on standard input. ( The above example uses Bash here string. )
The time can be specified in various formats, either absolute ( eg. 12:34 august 20 2011 ) or relative ( eg. now + 3 week ). If the date part is missing ( eg. 3 pm ), means the closest next occurrence of that time. If the time part is missing ( eg. next friday ), means the same time as now.
When scheduling a job, a shell script is generated, which will be executed at the specified time. That script also sets most of the environment variables, so the PATH mismatches encountered with cron jobs are bypassed. But note that for example DISPLAY is not restored, so jobs interacting with the X window system must take care about it themselves.
Installation
Configuration
The at Frugalware package does not contain the pam configuration for atd, without that every job will fail and will write Authentication failure into /var/log/cron.
The solution is to create the following file :
auth required pam_rootok.so account required pam_localuser.so session required pam_loginuid.so
Links
- http://en.wikipedia.org/wiki/At_(Unix) Wikipedia article
- http://frugalware.org/packages/17 Frugalware package