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 10-09-2016, 08:10 AM
n10002 n10002 is offline
Registered User
 
Join Date: Oct 2016
Posts: 1
Question Support required for Auto-backup script

Hi,

I want to have some script which will automatically login into my different devices through Secure-CRT or putty then will automatically save the logs for the command output "display current-configuration".

Additionally 3 points I would like to point :
1)Output of the above command contains lengthy output and it shows "More" after few lines then I have to press "Spacebar" for next few lines.
2)Count of "Spacebar" required is not fixed as the output will be long depending on configuration in system.
3)This script should contain Device-IP, Username & Password for different device. Also seperate log-files should be generated for each device and name of the log-file generated should be based on device name & current date & time.

Regards,
Nitesh
Reply With Quote
  #2  
Old 10-10-2016, 08:34 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,942
Hi Nitesh,

What version of SecureCRT are you using?

On what platform/OS?

Please check out the example scripts here.


Quote:
1)Output of the above command contains lengthy output and it shows "More" after few lines then I have to press "Spacebar" for next few lines.
You should be able to run a command (such as term len 0 or pager 0) to disable the --More-- prompts on Cisco devices. Otherwise, you would need to handle the
"--More--" prompts in the script in some fashion:

Code:
    ' Wait for either the shell prompt to appear or the
    ' "--More--" prompt to appear. If the shell prompt
    ' appears, we know that there isn't any more
    ' "--More--"'s to worry about, so we'll exit the loop.
    Do
        nStringIndex = objTab.Screen.WaitForStrings("]$", "--More--", 30)
        Select Case nStringIndex
            Case 0
                ' Timed out after 30 seconds waiting for either string.
                ' Since we expect a screen-full of data to come within
                ' 30 seconds, if nothing appears we'll just exit the
                ' loop
                Exit Do

            Case 1
                ' Shell prompt was found... exit 'do' loop
                Exit Do

            Case 2
                ' We found a "--More--" prompt.
                objTab.Screen.Send " "
        End Select
    Loop
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730

Last edited by jdev; 11-09-2017 at 11:27 AM.
Reply With Quote
Reply

Tags
auto-backup script


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 04:45 AM.