News | About | Get Frugalware | Packages | Documentation | Discussion Forums | Bug Tracker | Wiki | Community | Development

At

From FrugalWiki

Jump to: navigation, search


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.

Note: Regardless the current and the login shell, the job is always executed using /bin/sh.

Installation

Root terminal 48px.png
# pacman-g2 -S at


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 :

File: /etc/pam.d/atd
auth required pam_rootok.so
account required pam_localuser.so
session required pam_loginuid.so
Warning: pam configuration mindlessly copied from OpenSuse forum based on a suggestion by LGee on #frugalware.hu


Links

Personal tools
Namespaces
Variants
Actions