#1
|
|||
|
|||
I want to save to file.
this is my script.
When I finish this script, I want to save output to local file c:\Date-time. help me.. ^^; Thank you very much. # $language = "python" # $interface = "1.0" # This automatically generated script may need to be # edited in order to work correctly. #------------------------------------------------------------------------# def do1(): crt.Screen.Send("cat /proc/sys/fs/file-nr" + chr(13)) def do2(): crt.Screen.Send("dpkg -l | grep lvm" + chr(13)) def do3(): crt.Screen.Send("echo" + chr(13)) #------------------------------------------------------------------------$ def dooo1(): #Command Detail crt.Screen.WaitForString("test@test") do1() crt.Screen.WaitForString("test@test") def dooo2(): #Command Detail do2() crt.Screen.WaitForString("test@test") def dooLast(): #Command Detail do3() crt.Screen.WaitForString("test@test") crt.Screen.Send("exit" + chr(13)) crt.Screen.WaitForString("adminuser@domain.com:~$") def doall(): #Command Detail dooo1() dooo2() dooLast() def Main(): crt.Screen.Send("ssh -p 22 test@test1a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test2a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test3a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test4a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test5a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test6a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test7a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test8a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test9a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test10a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test11a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test12a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test13a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test14a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test15a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test16a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test17a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test18a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test19a.p19" + chr(13)) doall() crt.Screen.Send("ssh -p 2202 test@test20a.p19" + chr(13)) doall() Main() |
#2
|
|||
|
|||
Hi Junho,
You can find Python documentation on writing files at the following location: https://docs.python.org/2/tutorial/inputoutput.htmlSection 7.2 is specific to reading and writing files. You can find Python documentation about working with the system time and date at the following location: https://docs.python.org/2/library/datetime.htmlWe also have an example script that uses the information in the referenced Python documentation at the following location: https://forums.vandyke.com/showthrea...7294#post37294In the example script, the GetSafeFilename() function shows how to use the Python datetime module. Does this help you finish writing your script? |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | Rate This Thread |
|
|