Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > Cisco > EEM: how to add the current date&time to a filename

Reply
Thread Tools

EEM: how to add the current date&time to a filename

 
 
stephan
Guest
Posts: n/a
 
      02-11-2010
Hi All,

For an automated backup of a running config I try to use EEM.
But cant figure out how to add the current date and time to the filename.

event manager environment mybackuploc tftp://192.168.200.11/
event manager environment myfilename cr-u1-cfgbkp
event manager environment myfilenameext .txt
event manager environment dash -
event manager applet bkp_when_changed trap
event cli pattern "wr" sync no skip no
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "file prompt quiet"
action 4.0 cli command "end"
action 5.0 cli command "copy running
$mybackuploc$myfilename$myfilenameext"
action 6.0 cli command "config t"
action 7.0 cli command "no file prompt quiet"
action 8.0 cli command "end"


Is there a way to read the current time and use it as a env-variable?
somethink like:
event manager environment currdate $$$date$$$
event manager environment currtime $$$time$$$

so, that the
$mybackuploc$myfilename$dash$currdate$dash$currtim e$myfilenameext

creates a file like
cr-u1-cfgbkp-02-11-2010-21.37.txt on the tftp-srvr?

Any help would be very much appreciated.

stephan
 
Reply With Quote
 
 
 
 
Alexander Romanov
Guest
Posts: n/a
 
      02-13-2010
12.02.10 8:40, stephan пишет:
> Hi All,
>
> For an automated backup of a running config I try to use EEM.
> But cant figure out how to add the current date and time to the filename.


maybe a bad answer, but
try to use RANCID - Really Awesome New Cisco confIg Differ
http://www.shrubbery.net/rancid/

i use it for two years, about hundred of different devices - 26xx,
28xx, 29xx, 72xx, etc
very good soft

--- news://freenews.netfront.net/ - complaints: http://www.velocityreviews.com/forums/(E-Mail Removed) ---
 
Reply With Quote
 
 
 
 
stephan
Guest
Posts: n/a
 
      02-13-2010
Hi Alexander

> maybe a bad answer, but
> try to use RANCID - Really Awesome New Cisco confIg Differ
> http://www.shrubbery.net/rancid/


No, its a good answer.
As good as Kiwi-CatTools. Thats the app I used.

My idea was to work with a built-in feature then using an external app.

Thanks anyway.
/s
 
Reply With Quote
 
bod43
Guest
Posts: n/a
 
      02-16-2010
On 13 Feb, 16:51, stephan <(E-Mail Removed)> wrote:
> Hi Alexander
>
> > maybe a bad answer, but
> > try to use RANCID - Really Awesome New Cisco confIg Differ
> >http://www.shrubbery.net/rancid/

>
> No, its a good answer.
> As good as Kiwi-CatTools. Thats the app I used.
>
> My idea was to work with a built-in feature then using an external app.
>
> Thanks anyway.
> /s


If you switch to using tcl scripts from EEM then you
can do anything you want.

For example, as a way to learn a bit about tcl
I worte a "game of life" in tcl that I could run
by pasting the code into the router. (Of course
the code could have been put in a file on the flash, but
I have still not got the necesary round tuits.)

Was way cool seeing the evolving lifescape
scrolling up the console screen.

Sadly, it was not enough to get me a
job as a test engineer chez cisco

http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life

I got the idea from a game of life written in
postscript that you could run on a printer.

The lifescape emerged on pieces of paper))

If your router does tcl, you can see some nice sample
scripts as follows:-

router#show event manager policy available
No. Type Time Created Name
1 system Thu Feb 7 06:28:15 2036 ap_perf_test_base_cpu.tcl
2 system Thu Feb 7 06:28:15 2036 no_perf_test_init.tcl
3 system Thu Feb 7 06:28:15 2036 sl_intf_down.tcl
4 system Thu Feb 7 06:28:15 2036 tm_cli_cmd.tcl
5 system Thu Feb 7 06:28:15 2036 tm_crash_reporter.tcl
6 system Thu Feb 7 06:28:15 2036 tm_fsys_usage.tcl

router# show event manager policy
available detailed ap_perf_test_base_cpu.tcl

or whatever the script you want to view is called.

There are also sample scripts here -
http://forums.cisco.com/eforum/servl...tId=0&count=20

EEM info -
http://www.cisco.com/en/US/products/...roup_home.html
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
The filename set in the response.setHeader("Content-Disposition", "attachment; filename=test.csv") is being ignored! Ed Java 10 07-13-2010 12:43 PM
Stitch rar files ( filename.part01 and filename.part02) Please help ixgor Software 1 10-15-2006 02:33 AM
how to get 8.3 format filename from long filename jacobyv@sis.unibe.ch Java 1 06-15-2006 10:39 AM
Extract filename from a filename typed by user =?Utf-8?B?Sm9l?= ASP .Net 1 08-23-2004 11:29 PM



Advertisments