THE VIRTUAL SERVER HANDBOOK
Notice the use of the "virtual" command in the above example. The virtual
command is used to run scripts from the user s "home" directory. It should
be pointed out here that CRON jobs do not run from the Virtual Server
environment. They run from the physical server environment but run under
the Virtual Server User ID (a special number that keeps track of users, what
files they own, and what processes they own). For this reason, when you try
and run scripts or programs from Cron, you must include the full path to the
script. This includes the path to your "home" directory. For example, if my
Telnet login were "judy", the path to my home directory would be
/usr/home/judy/
. This is the path from the physical server s root file
structure.
Example Cron for sending a notice to occasionally mail information to
judy:
01 09 14,30 1,3,5,7,8,10,12 * cat $HOME/etc/
Cronfile/my_ Cron_file | /usr/bin/mail s
"Message goes here" judy@somedomain.com
Note: The use of the environmental variable
$HOME
, enables you to do
the same thing as the virtual command.
Example Cron for automating stats using getstats:
40 19 * * * /usr/local/bin/getstats d f |
/usr/bin/mail s "HTTP Daily stats"
judy@somedomain.com
Example Cron for producing a weekly "getstats" report
40 19 * * 1 /usr/local/bin/getstats w f |
/usr/bin/mail s "HTTP Weekly stats"
judy@somedomain.com
Example Cron for nuking the logs with the n option
40 19 1 * * /usr/local/bin/getstats w f n |
/usr/bin/mail s "HTTP Monthly Stats"
judy"@somedomain.com
Note: Nuking the logs only occurs after Cron has produced a weekly
"getstats" report.
COPYRIGHT
1999 DIGITAL TOOLS LLC.
60