Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-18-2006, 12:34 AM
samoki samoki is offline
Registered User
 
Join Date: Jun 2006
Posts: 24
[Help]How can two script operate one file?

I program to backup devices' configuration.
I want to use a single script to load SecureCRT,and do something below:
1.connetct devices
2.backup
3.quit SecureCRT
All of this steps(include load SecureCRT),I want to realize in one script.Can I???

If can,how to do that?

If can't,how can SecureCRT use Wscript,I quote this function"Wscript",when I use it in some sentence,error appear"Variable is not defined:'WScript'".


Last question,I want realize:two script,one watch the log file's size and another write some records to log file continually,so if can that two script operate one and the same log file at the same time,give me a example please.Thanks

Last edited by samoki; 08-19-2006 at 10:07 PM.
Reply With Quote
  #2  
Old 08-18-2006, 07:16 AM
miked's Avatar
miked miked is offline
Registered User
 
Join Date: Feb 2004
Posts: 2,040
The easiest way to capture data is to use a log file.

When connecting to and backing up devices, are you wanting to capture the entire interaction between SecureCRT and the device, or only a portion of the interaction?

Regarding your last question, it would be possible to enable logging inside of a script, and inside the same script monitor the size of the log file. Will this work for you?
__________________
Mike
VanDyke Software
Technical Support
[http://www.vandyke.com/support]
Reply With Quote
  #3  
Old 08-18-2006, 09:15 AM
samoki samoki is offline
Registered User
 
Join Date: Jun 2006
Posts: 24
I explain in detail:
This script's basic ideas is read information from an excel file,the excel file include devices' name,ip and other information.The first script(main script) need read part of these information,and make some other files for bakup process use,because the excel file has some kinds of devices that need not to bakup, the first script must record which device backup,which skiped,which succeed,which fail,and so on.Then main script call SecureCRT and run the second script.
The second script is used by SecureCRT to execute backup and write log to log file,I do not want to use SecureCRT's log,because I only need to know if backup is succeed or fail with every device,needn't process.(There are too many devices with four or five kinds,if use SecureCRT's log,it will be too long,and I must work hard to find useful information).When backup is over,SecureCRT will close,and then log file's size will keep same size.If the first script can watch the log file's size,and judge if backup processing is over.If backup is over,the main script will delete all temporary file,and close script.
Base on these ideas,I meet these questions that I had written in the thread.Can you give me some suggestion?
In addition,when I use sentence "path = WScript.ScriptFullName",error appeared"Variable is not defined:WScript",but it's a standard sentence supply with WSH(Windows Script Host).How can I use it"WScript"?
Thanks.

By the way,can I realize all fuction in one script?I mean if there has some way,I do not need use SecureCRT to run the scond script,when main script call SecureCrt,it can input commands directly,and can use functions like "crt.waitstring" and so on.Does SecureCRT offer program interface to external vbscript program.

Last edited by samoki; 08-19-2006 at 09:07 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT -6. The time now is 05:11 AM.