11-06-2018 08:33 AM - edited 03-08-2019 04:33 PM
Hello,
I have a lot of switches in need to backup. I have Kron working if I set the file name manually. For example, show run | redir tftp://10.5.7.50/folder/switch.txt. My question is, is there a way to automatically insert the hostname into this command. Something along tftp://10.5.7.50/folder/%hostname%.txt ?
Solved! Go to Solution.
11-06-2018 11:50 AM
Hello,
here is an example. The $t should add a timestamp to your filename as well...
archive
path tftp://10.5.7.50/folder/$h-$t
write-memory
!
kron policy-list SHOWRUN
cli write memory
!
kron occurence SHOWRUN_COPY at 22:00 recurring
policy-list SHOWRUN
11-06-2018 10:37 AM
Hello,
try:
tftp://10.5.7.50/folder/$h-
The '$h-' will be replaced with your hostname...
11-06-2018 11:21 AM
Hi George,
Unfortunately this is only creating a $h- file name in my tftp server.
11-06-2018 11:47 AM
Hello,
sorry about that: Try without the hyphen:
$h
11-06-2018 11:50 AM
Hello,
here is an example. The $t should add a timestamp to your filename as well...
archive
path tftp://10.5.7.50/folder/$h-$t
write-memory
!
kron policy-list SHOWRUN
cli write memory
!
kron occurence SHOWRUN_COPY at 22:00 recurring
policy-list SHOWRUN
11-06-2018 12:48 PM
11-06-2018 12:59 PM
Hello,
--> kron policy-list SHOWRUN
cli write memory | redir tftp://10.5.7.50/folder/$t-$t
The variable only works in the archive, not in KRON unfortunately...
11-06-2018 01:15 PM
Well that explains all the confusion. Thanks again.
01-27-2022 03:24 PM
Thanks for this, it worked for me.
My question is, is it possible to save the configuration using archive to multiple TFTP servers at once (I have 2 tftp servers)?
I tried adding a second tftp path, but then that becomes the main path for saving the config.
Thanks!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide