10-12-2004 07:23 AM
Hi
I wanna to write a script that automatically backup my configuration to a ftp-server. If a play the script from the console it works fine, but if a write a cmd-sched then it doesn't work. The Variable UGREP is not recognised and the USER that playes the script is rcmd-sched.
*******
show profile | grep -u "@prompt"
echo "${UGREP}"
set HOSTNAME "${UGREP}[2]"
show ver
show clock | grep -u "Date"
set DATE "${UGREP}[2]"
set FTPSTATE "${HOSTNAME}_${DATE}"
copy running-config ftp SAVE_CONF_FTP ${FTPSTATE}
********
10-18-2004 01:46 PM
Here is a tech tip on how to use the cmd-sched
http://www.cisco.com/en/US/products/hw/contnetw/ps789/products_tech_note09186a0080094348.shtml
and also a link on the CSS scripting language.
10-19-2004 06:41 AM
try the command from the user that the script works for:
copy profile default profile
I had this issue when I wrote an alias and it wouldn't run in the cmd-sched.
10-19-2004 09:23 PM
The command works fine when I start it from the user context. IT doesn't work when it runs in the cmd-sched.
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