cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2431
Views
0
Helpful
2
Replies

how to scp a file in 7600 using EEM/Tcl

nikos_skalis
Level 1
Level 1

Hello All,

I have a Tcl file on 7600 that produces a file, and I would like to copy this file to a server using scp.

This is how the file looks like :

::cisco::eem::event_register_none maxrun 240

#::cisco::eem::event_register_timer cron cron_entry "*/5 * * * *" maxrun 240

namespace import ::cisco::eem::*

namespace import ::cisco::lib::*

array set arr_einfo [ event_reqinfo ] ;

if [ catch {cli_open} rc ] {

       error $rc $errorInfo

} else {

       array set clifd $rc

}

set          filename          "IOS7600.dat_12345" ;

set     transfer        "copy disk0:/" ;        append transfer $filename ;     append  transfer " scp://username:password@ip:" ;

if [ catch {cli_exec $clifd(fd) $transfer} rc ] {

        error $rc $errorInfo

}

if [ catch {cli_close $clifd(fd) $clifd(tty_id)} rc ]  {

       error $rc $errorInfo

}

The problem is that scp: hangs ! Could you please help me to work-around this ? What am I doing wrong ?

Many Thanks.

Kind Regards,

Nikos

2 Replies 2

nikos_skalis
Level 1
Level 1

An alternative would be to write an applet, like :

event timer cron name PUSH-CoPP cron-entry "*/5 * * * *" maxrun 240

to do the following command :

set     transfer        "copy disk0:/" ;        append transfer $filename ;     append  transfer " scp://username:password@ip:" ;

but how can I provide the filename, I could use a regexp like :

*IOS7600*

and then answer the related to scp dialog using action statements.

Could you please help me with this please ?

Many Thanks.

Kind Regards,

Nikos

file prompt quiet ... works