host1#
schedule macro at 20:00 February 16 larry.mac getuptime
To show the set of currently scheduled macros (asterisks indicate persistent macros):
host1#
show schedule macro
interval
macro privilege interval frequency
file name macro level time-of-day (minutes) schedule started
--------- --------- --------- ------------------ --------- ------------------- -------
fred.mac Freddie 15 00:10 DayOfMonth:2 --- 2007-03-02 00:10:00 ---
*joe.mac start 15 00:00 sunday --- 2007-02-18 00:00:00 ---
john.mac getuptime 15 --- 30 2007-02-14 14:26:38 ---
larry.mac start 15 --- --- 2007-02-16 20:00:00 ---
moe.mac start 15 --- --- 2007-02-14 20:00:00 ---
To display the run time of one macro scheduled in Global Configuration mode, creating
an entry that l persists across reboots:
host1#
show schedule macro joe.mac
joe.mac start is persistent and scheduled to run at 2007-02-18 00:00:00
To display the start time of one running macro:
host1#
show schedule macro john.mac
john.mac getuptime started at 2007-02-14 14:26:39
When you show the running configuration, joe.mac is the only one reported, because the
other macros were scheduled in Privileged Exec mode.
host1#
show conf | include schedule
schedule macro joe.mac interval time-of-day 00:00 day-of-week sunday start
When you display the directory listing, it shows the scheduled macros are all in-use and
cannot be deleted:
unshared in
file size size date (UTC) use
----------------------------- -------- -------- ------------------- ---
disk0:m.mac 438 438 01/26/2007 10:12:26 !
disk0:fc.mac 515 515 01/26/2007 12:29:14 !
disk0:b.mac 7728 7728 02/05/2007 13:55:10 !
disk0:c.mac 146 146 02/07/2007 16:09:12 !
disk0:mmcX2.rel 859484 83859484 02/05/2007 16:01:50 !
host1#
delete joe.mac
% File in use
Example
Running a scheduled macro one time. Run macro m in m.mac at 14:35 today.
host#
more m.mac
<# m(left,right,third) #>
<# mult := left * right #>
<# multFinal := mult * third #>
<# env.setResult("operation", "" $ left $ " * " $ right $ " * " $ third) #>
485
Copyright © 2010, Juniper Networks, Inc.
Chapter 8: Writing CLI Macros
Summary of Contents for JUNOSE 11.3
Page 6: ...Copyright 2010 Juniper Networks Inc vi...
Page 8: ...Copyright 2010 Juniper Networks Inc viii JunosE 11 3 x System Basics Configuration Guide...
Page 24: ...Copyright 2010 Juniper Networks Inc xxiv JunosE 11 3 x System Basics Configuration Guide...
Page 32: ...Copyright 2010 Juniper Networks Inc 2 JunosE 11 3 x System Basics Configuration Guide...
Page 146: ...Copyright 2010 Juniper Networks Inc 116 JunosE 11 3 x System Basics Configuration Guide...
Page 166: ...Copyright 2010 Juniper Networks Inc 136 JunosE 11 3 x System Basics Configuration Guide...
Page 432: ...Copyright 2010 Juniper Networks Inc 402 JunosE 11 3 x System Basics Configuration Guide...
Page 488: ...Copyright 2010 Juniper Networks Inc 458 JunosE 11 3 x System Basics Configuration Guide...
Page 524: ...Copyright 2010 Juniper Networks Inc 494 JunosE 11 3 x System Basics Configuration Guide...
Page 554: ...Copyright 2010 Juniper Networks Inc 524 JunosE 11 3 x System Basics Configuration Guide...
Page 566: ...Copyright 2010 Juniper Networks Inc 536 JunosE 11 3 x System Basics Configuration Guide...
Page 588: ...Copyright 2010 Juniper Networks Inc 558 JunosE 11 3 x System Basics Configuration Guide...
Page 613: ...PART 3 Index Index on page 585 583 Copyright 2010 Juniper Networks Inc...
Page 614: ...Copyright 2010 Juniper Networks Inc 584 JunosE 11 3 x System Basics Configuration Guide...
Page 632: ...Copyright 2010 Juniper Networks Inc 602 JunosE 11 3 x System Basics Configuration Guide...