Hi Ophir,
Thank you for your information. Sorry, I didn't post my question clearly.
I should ask: How do you do you backup your Mellanox switch to a remote server?
I have written a small script to do the backup. But, it didn't work for Mellanox. However, with a small change, the script it will work for Cisco router, switches etc...
After "show run" it didn't display the configuration.
Here is the expect script on a Linux server.
#!/usr/bin/expect
set timeout 10
set name "admin"
set pass1 "admin"
set hostlist "mellanox1"
spawn ssh $name@$hostlist
expect "Password:"
send "$pass1\r"
expect "*>"
send "enable\r"
expect "*#"
send "terminal length 800\r"
expect "*#"
set time [exec date \+\%y\%m\%d]
set filename $hostlist-$time
log_file /home/mydir/$filename
send "\r"
expect "*#"
send "show run\r"
expect "*#"
send "exit\r"
log_file