Using Cron With Scheduled Reports - Juniper NETWORK AND SECURITY MANAGER 2010.4 - ADMININISTRATION GUIDE REV1 Administration Manual

Table of Contents

Advertisement

Copyright © 2010, Juniper Networks, Inc.

Using Cron with Scheduled Reports

The actual scheduling is done using the cron application. This utility executes scripts at
specific times. It is configured through a file called
command crontab -e. This command invokes the
Entries in the table consist of a command set and a schedule. The command to run the
report is the same as described above.
The timing of the job is determined by a string of numbers preceding the script. There are
five places and they represent, in order:
Minute (0-59)
Hour (0-23)
Day of Month (1-31)
Month (1-12)
Day of Week (0-6) (Sunday = 0)
Use an asterisk(*) to mark a place that is not part of the given schedule. For example,
to run a script every Tuesday night at 11:05 PM, use "5 23 * * 2 Script".
In this example, perform the following steps to generate a predefined report and FTP it
to a server every Monday at 12:01 in the morning:
Change to the utility directory by typing cd /usr/netscreen/GuiSvr/utils
1.
Create a shell script called
2.
Set the NSMUSER environment variable with an NSM domain/user pair, for
a.
example:
export NSMUSER=domain/user
Set the NSMPASSWD environment variable with an NSM password. The command
b.
for setting environment variables depends on your operating system and shell, for
example:
export NSMPASSWD=password
Specify a
command string
c.
guiSvrCli
/usr/netscreen/GuiSvr/utils/guiSvrCli.sh --generate-reports --report
global:system:"\"Top Screen Attacks\" " --script ftp.sh
Make the script executable. Make sure the person who creates the cron job can run
3.
the script.
Run the crontab editor:
4.
crontab -e
Add the following line:
5.
0 0 * * 1 /usr/netscreen/GuiSvr/utils/reportscript.sh
crontab
editor and opens the crontab table.
vi
:
reportscript.sh
Chapter 20: Reporting
. To edit the file, use the
821

Advertisement

Table of Contents
loading

This manual is also suitable for:

Network and security manager 2010.4

Table of Contents