-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the log collection policy of Fabric && expand functions
- Loading branch information
1 parent
d5b7b46
commit 643912f
Showing
6 changed files
with
254 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/expect | ||
############################################################################################ | ||
#Program name: createPath.exp | ||
#function: Create path for logs | ||
#time: 2020-03-17 | ||
############################################################################################ | ||
if {$argc < 4} { | ||
send_user "Usage: expect createPath.exp sftp_IP sftp_User sftp_Pass logs_path.\n" | ||
exit | ||
} | ||
|
||
set sftp_IP [lindex $argv 0] | ||
set sftp_User [lindex $argv 1] | ||
set sftp_Pass [lindex $argv 2] | ||
set log_Path [lindex $argv 3] | ||
|
||
set timeout -1; | ||
spawn sftp -o StrictHostKeyChecking=no ${sftp_User}@${sftp_IP} | ||
expect "*assword:" {send "${sftp_Pass}\r"} | ||
expect "*sftp>" {send "mkdir ${log_Path}\r"} | ||
expect "*sftp>" {send "bye\r"} | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/expect | ||
############################################################################################ | ||
#Program name: send_ShowFile.exp | ||
#function: Send supportshow file to sftp | ||
#time: 2020-03-17 | ||
############################################################################################ | ||
if {$argc < 6} { | ||
send_user "Usage: expect send_ShowFile.exp sftp_IP sftp_User sftp_Pass local_Path sftp_Path log_File.\n" | ||
exit | ||
} | ||
|
||
set sftp_IP [lindex $argv 0] | ||
set sftp_User [lindex $argv 1] | ||
set sftp_Pass [lindex $argv 2] | ||
set local_Path [lindex $argv 3] | ||
set sftp_Path [lindex $argv 4] | ||
set log_File [lindex $argv 5] | ||
|
||
set timeout -1; | ||
spawn sftp -o StrictHostKeyChecking=no ${sftp_User}@${sftp_IP} | ||
expect "*assword:" {send "${sftp_Pass}\r"} | ||
expect "*sftp>" {send "cd ${sftp_Path}\r"} | ||
expect "*sftp>" {send "lcd ${local_Path}\r"} | ||
expect "*sftp>" {send "put ${log_File}\r"} | ||
expect "*sftp>" {send "bye\r"} | ||
exit 0 |
Oops, something went wrong.