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
crontab
. To edit the file, use the
command
crontab -e
. This command invokes the
vi
editor and opens the crontab table.
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:
1.
Change to the utility directory by typing
cd /usr/netscreen/GuiSvr/utils
2.
Create a shell script called
reportscript.sh
:
a.
Set the NSMUSER environment variable with an NSM domain/user pair, for
example:
export NSMUSER=
domain/user
b.
Set the NSMPASSWD environment variable with an NSM password. The command
for setting environment variables depends on your operating system and shell, for
example:
export NSMPASSWD=
password
c.
Specify a guiSvrCli command string
/usr/netscreen/GuiSvr/utils/guiSvrCli.sh --generate-reports --report
global:system:"\"Top Screen Attacks\” " --script ftp.sh
3.
Make the script executable. Make sure the person who creates the cron job can run
the script.
4.
Run the crontab editor:
crontab -e
5.
Add the following line:
0 0 * * 1 /usr/netscreen/GuiSvr/utils/reportscript.sh
821
Copyright © 2010, Juniper Networks, Inc.
Chapter 20: Reporting
Summary of Contents for NETWORK AND SECURITY MANAGER 2010.4 - ADMININISTRATION GUIDE REV1
Page 6: ...Copyright 2010 Juniper Networks Inc vi...
Page 36: ...Copyright 2010 Juniper Networks Inc xxxvi Network and Security Manager Administration Guide...
Page 52: ...Copyright 2010 Juniper Networks Inc 2 Network and Security Manager Administration Guide...
Page 90: ...Copyright 2010 Juniper Networks Inc 40 Network and Security Manager Administration Guide...
Page 146: ...Copyright 2010 Juniper Networks Inc 96 Network and Security Manager Administration Guide...
Page 236: ...Copyright 2010 Juniper Networks Inc 186 Network and Security Manager Administration Guide...
Page 292: ...Copyright 2010 Juniper Networks Inc 242 Network and Security Manager Administration Guide...
Page 314: ...Copyright 2010 Juniper Networks Inc 264 Network and Security Manager Administration Guide...
Page 368: ...Copyright 2010 Juniper Networks Inc 318 Network and Security Manager Administration Guide...
Page 370: ...Copyright 2010 Juniper Networks Inc 320 Network and Security Manager Administration Guide...
Page 484: ...Copyright 2010 Juniper Networks Inc 434 Network and Security Manager Administration Guide...
Page 584: ...Copyright 2010 Juniper Networks Inc 534 Network and Security Manager Administration Guide...
Page 588: ...Copyright 2010 Juniper Networks Inc 538 Network and Security Manager Administration Guide...
Page 600: ...Copyright 2010 Juniper Networks Inc 550 Network and Security Manager Administration Guide...
Page 678: ...Copyright 2010 Juniper Networks Inc 628 Network and Security Manager Administration Guide...
Page 694: ...Copyright 2010 Juniper Networks Inc 644 Network and Security Manager Administration Guide...
Page 700: ...Copyright 2010 Juniper Networks Inc 650 Network and Security Manager Administration Guide...
Page 706: ...Copyright 2010 Juniper Networks Inc 656 Network and Security Manager Administration Guide...
Page 708: ...Copyright 2010 Juniper Networks Inc 658 Network and Security Manager Administration Guide...
Page 758: ...Copyright 2010 Juniper Networks Inc 708 Network and Security Manager Administration Guide...
Page 788: ...Copyright 2010 Juniper Networks Inc 738 Network and Security Manager Administration Guide...
Page 882: ...Copyright 2010 Juniper Networks Inc 832 Network and Security Manager Administration Guide...
Page 908: ...Copyright 2010 Juniper Networks Inc 858 Network and Security Manager Administration Guide...
Page 918: ...Copyright 2010 Juniper Networks Inc 868 Network and Security Manager Administration Guide...
Page 920: ...Copyright 2010 Juniper Networks Inc 870 Network and Security Manager Administration Guide...
Page 1005: ...PART 6 Index Index on page 957 955 Copyright 2010 Juniper Networks Inc...
Page 1006: ...Copyright 2010 Juniper Networks Inc 956 Network and Security Manager Administration Guide...