04-28-2021 05:01 PM
Hello Everyone!
I'm trying to create/write a file in bootflash: through a script and It fails... I tried to run the command directly in the TCLSH interpreter but I get this message:
N7K-CORE# tclsh N7K-CORE-tcl# open bootflash:///clock.log "a+" couldn't open "bootflash:///clock.log": no such file or directory N7K-CORE-tcl# open bootflash://clock.log "a+" couldn't open "bootflash://clock.log": no such file or directory N7K-CORE-tcl# open bootflash:/clock.log "a+" couldn't open "bootflash:/clock.log": no such file or directory N7K-CORE-tcl# dir 4096 Apr 28 17:32:52 2021 Scripts/ 0 Apr 28 17:30:22 2021 clock.log 0 Apr 28 17:29:44 2021 infoTAC.log 664 Sep 29 15:22:10 2014 vlan.dat Usage for bootflash:// 1281138688 bytes used 535347200 bytes free 1816485888 bytes total N7K-CORE-tcl# exit
Any thoughts?
Thanks in advance.
Adrian
04-29-2021 01:58 AM
Can you able to read the file : (it is 0 size ?)
show file bootflash://clock.log
04-29-2021 08:41 AM
Hi, yeah, it's empty beacause the original message was like "there's not such file", so I thought maybe it need the file to already exists so I created empty...
Now, I've just uploaded a new file with some content and yes I can read it:
N7K-CORE# show file bootflash:clock.log Sample Text working on it... N7K-CORE#
I tried the same tests and I aaded the last line, so I thought it works without slashes:
N7K-CORE-tcl# open bootflash:///clock.log "a+" couldn't open "bootflash:///clock.log": no such file or directory N7K-CORE-tcl# open bootflash://clock.log "a+" couldn't open "bootflash://clock.log": no such file or directory N7K-CORE-tcl# open bootflash:/clock.log "a+" couldn't open "bootflash:/clock.log": no such file or directory N7K-CORE-tcl# open bootflash:clock.log "a+" file37 N7K-CORE-tcl#
I tried again writing in the file without the slashes but It's waiting for an integer... I tried the integer and it didn't write anything:
N7K-CORE-tcl# open bootflash:clock.log "a+" { > "insert new line here" > } expected integer but got " "insert new line here" " N7K-CORE-tcl# open bootflash:clock.log "a+" { > 256 > } file38 N7K-CORE-tcl# exit N7K-CORE# show file bootflash:clock.log Sample Text working on it... N7K-CORE1#
Any other idea? Anyway, thanks for your time
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: