16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

When matching the date and time expressions given in crontab entries, cron uses<br />

the time zone in effect when the system started the daemon. As a result, you<br />

should ensure that the TZ environment variable is set at this time. For information<br />

on setting the TZ environment variable, see Appendix I. For at jobs, cron uses the<br />

value of TZ in effect when you submitted the job.<br />

at, batch, and crontab submit jobs to cron; the data for those jobs can contain<br />

doublebyte characters. When the jobs are executed, the data in the jobs are<br />

interpreted in the locale that cron is using. Because it is strongly recommended that<br />

cron be started in the P<strong>OS</strong>IX locale, doublebyte characters in the jobs may not be<br />

interpreted correctly. You can get around this by calling the setlocale() system call<br />

in the job itself.<br />

The crontab, batch, and at job files store information about the MVS identity and<br />

the <strong>UNIX</strong> identity (the real UID) of the user who created the jobs. The cron daemon<br />

uses that information to set up the environment in which to run the jobs as follows:<br />

v the MVS identity is set to the user’s MVS identity.<br />

v the <strong>UNIX</strong> real and effective UIDs are set to the user’s real UID.<br />

cron handles the following externally generated signals in a special way:<br />

SIGTERM<br />

Causes cron to exit. You can cause cron to exit with the following<br />

command:<br />

kill –TERM pid<br />

where pid is the cron’s PID number. To find the cron’s PID number, you can<br />

use:<br />

ps -e | grep cron<br />

SIGUSR1<br />

Is sent by either at or crontab to indicate a new at job or an updated<br />

crontab entry. cron does not delete at jobs until they finish running. If the<br />

cron daemon is terminated while at jobs are running, cron runs them again<br />

when the daemon is restarted.<br />

SIGUSR2<br />

Writes internal cron queue information to the log file.<br />

The following is an example of output to a cron log from ’kill -USR2 5’. The<br />

output was written to the log on a test system when the queuedefs job limit of 5<br />

was exceeded. The number of jobs that are running is 5 (the limit is 500):<br />

Queue `c’ 5j2n15w:<br />

queued 4, running 5, jobs 5<br />

Next try for queued jobs 13 seconds<br />

RUNNING: uid/gid: 0/512: pid 33554441: sleep 10000 RUNNING: uid/gid: 0/512:<br />

pid 385875972: echo start; sleep 10000; echo end RUNNING: uid/gid: 0/512: pid<br />

67108876: echo start; sleep 10000; echo end RUNNING: uid/gid: 0/512: pid<br />

33554445: echo start; sleep 10000; echo end RUNNING: uid/gid: 0/512: pid<br />

67108879: echo start; sleep 10000; echo end QUEUED: uid/gid: 0/512: echo Hello!<br />

QUEUED: uid/gid: 0/512: echo start; sleep 10000; echo end<br />

QUEUED: uid/gid: 0/512: echo Hello!<br />

QUEUED: uid/gid: 0/512: echo start; sleep 10000; echo end<br />

cron uses a number of files in the /usr/lib/cron directory to determine which users<br />

may and may not use the at and crontab commands.<br />

v The file at.allow contains the list of users who have permission to use at.<br />

cron daemon<br />

v The file at.deny contains the list of users who do not have permission to use at.<br />

Chapter 2. Shell command descriptions 169

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!