LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-01-2015, 01:46 AM   #1
noob__
LQ Newbie
 
Registered: Apr 2014
Posts: 12

Rep: Reputation: Disabled
Unison and expect problem


I'm trying to to synchronize two folders from two servers.
I'm using unison for this... I have a problem to authenticate these 2 servers.

I'm using ssh key authentication + passphrase and I have to add passphrase every time.

So I chose to use expect program like this:



Code:
#!/usr/bin/expect

set timeout 20

set folder [lindex $argv 0]

set ssh_ip [lindex $argv 1]


set passp "abcde"

apend ssh_ip $folder

spawn unison -batch "$folder $ssh_ip"

expect "Enter passphrase for key '/root/.ssh/id_rsa':"

send "$passp\r";
after executing ./sssh /folder ssh://root@192.168.1.3/


Code:
spawn unison -batch /folder ssh://root@192.168.1.3//folder


Usage: unison [options]
    or unison root1 root2 [options]
    or unison profilename [options]


For a list of options, type "unison -help"
For a tutorial on basic usage, type "unison -doc tutorial"
For other documentation, type "unison -doc topics"

Profile /root/.unison//foler ssh://root@192.168.1.3//folder.prf 
does not exist
send: spawn id exp6 not open
    while executing
"send "$passp\r""
    (file ".sssh line 18")
 
Old 08-21-2015, 11:35 AM   #2
Neville Hillyer
Member
 
Registered: Jul 2015
Posts: 57

Rep: Reputation: Disabled
I don't know the answer but what happens if you replace the following double slash with a single slash?

//folder.prf
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[root@fugo trace]# sh expect.sh expect.sh: line 9: expect: command not found sivaloga Linux - Kernel 1 08-22-2013 04:29 AM
[SOLVED] /usr/bin/expect : Script to check server load using both expect and bash Soji Antony Programming 1 07-27-2010 11:27 PM
expect: line seems to match exactly, however expect thinks not deadeyes Linux - General 5 06-16-2010 06:05 PM
expect problem john83reuben Programming 5 07-30-2008 06:35 AM
problem in expect john83reuben Programming 1 07-16-2008 06:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration