| jun2004.tar |
Auxiliary Scriptsdatediff datediff (Listing 2) determines the number of seconds between two date-time strings. To perform the date arithmetic between the date-time objects, we use Scaliger's Julian Date algorithm. For a complete description and implementation of this algorithm, please see the "Date Arithmetic with the Shell" article from the July 2003, Sys Admin (http://www.samag.com/documents/s=8284/sam0307b/0307b.htm). Scaliger's algorithm is only in scope between years 1801 to 2099. For dates that fall within this range, check_cron uses this algorithm. Outside the 1801 to 2099 date range, datediff uses a brute-force method to determine the number of seconds between two date-times. secs2dhms secs2dhms (Listing 3) converts a number of seconds to an equivalent number of days, hours, minutes, and seconds with corresponding labels. For example:
secs2dhms 94550returns the following:
1 day 2 hours 15 minutes 50 secondsSetting the Environment The script /etc/setenv_path, listing 4, is tailored to our environment. It can be sourced by other shell scripts to assert the PATH, MANPATH, and FPATH variables. |