FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 01-07-2008, 12:03 PM
Johan Sandberg
 
Default Synchronize a directory over sftp

Hi all,
I am trying to find a way to automatically (or manually) synchronize my
home directory to a sftp server. I have tried Unison, but it seems that
Unison can't handle sftp. Is there anyone out there that can help me
out? It does not have to have a nice GUI. A simple cli or shell script
would be equally handy (or handier).
BR
/Johan

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-07-2008, 12:53 PM
Tony Arnold
 
Default Synchronize a directory over sftp

Johan,

Johan Sandberg wrote:

> I am trying to find a way to automatically (or manually) synchronize my
> home directory to a sftp server. I have tried Unison, but it seems that
> Unison can't handle sftp. Is there anyone out there that can help me
> out? It does not have to have a nice GUI. A simple cli or shell script
> would be equally handy (or handier).

Why does it need to be sftp? Unison will handle synchronisation over an
ssh connection (and if you have sftp you have ssh!). I do it all the time.

Regards,
Tony.
--
Tony Arnold, Tel: +44 (0) 161 275 6093
Head of IT Security, Fax: +44 (0) 870 136 1004
University of Manchester, Mob: +44 (0) 773 330 0039
Manchester M13 9PL. Email: tony.arnold@manchester.ac.uk

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-07-2008, 12:55 PM
Smoot Carl-Mitchell
 
Default Synchronize a directory over sftp

On Mon, 2008-01-07 at 14:03 +0100, Johan Sandberg wrote:
> Hi all,
> I am trying to find a way to automatically (or manually) synchronize my
> home directory to a sftp server. I have tried Unison, but it seems that
> Unison can't handle sftp. Is there anyone out there that can help me
> out? It does not have to have a nice GUI. A simple cli or shell script
> would be equally handy (or handier).

You can run the CLI sftp client from a batchfile. However, it does not
not do interactive password authentication. If you can set up public
key based authentication to authenticate to the server, you can then put
the file transfer commands in the batchfile. See the sftp man page for
the details.
--
Smoot Carl-Mitchell
System/Network Architect
email: smoot@tic.com
cell: +1 602 421 9005
home: +1 480 922 7313

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-07-2008, 01:10 PM
Lea Gris
 
Default Synchronize a directory over sftp

Johan Sandberg a écrit :
> Hi all,
> I am trying to find a way to automatically (or manually) synchronize my
> home directory to a sftp server. I have tried Unison, but it seems that
> Unison can't handle sftp. Is there anyone out there that can help me
> out? It does not have to have a nice GUI. A simple cli or shell script
> would be equally handy (or handier).
> BR
> /Johan
>

Rsync is done for that.

rsync --times --delete-excluded --compress --recursive --progress ~
user@remotehost:/destination/directory

--
Léa Gris - http://www.noiraude.net/
() Campagne du ruban texte brut contre les courriels en HTML,
/ contre les pièces jointes dans un format propriétaire.
Contre les DRMs appelez le : 09f911029d74e35bd84156c5635688c0


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-07-2008, 01:25 PM
Smoot Carl-Mitchell
 
Default Synchronize a directory over sftp

On Mon, 2008-01-07 at 15:10 +0100, Lea Gris wrote:

> Rsync is done for that.
>
> rsync --times --delete-excluded --compress --recursive --progress ~
> user@remotehost:/destination/directory

Yep, rysnc is very handy and efficient for remote synchronization.
However, the remote server may not let you use rsync.
--
Smoot Carl-Mitchell
System/Network Architect
email: smoot@tic.com
cell: +1 602 421 9005
home: +1 480 922 7313

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-07-2008, 03:00 PM
Lea Gris
 
Default Synchronize a directory over sftp

Smoot Carl-Mitchell a écrit :
> On Mon, 2008-01-07 at 15:10 +0100, Lea Gris wrote:
>
>> Rsync is done for that.
>>
>> rsync --times --delete-excluded --compress --recursive --progress ~
>> user@remotehost:/destination/directory
>
> Yep, rysnc is very handy and efficient for remote synchronization.
> However, the remote server may not let you use rsync.

If no rsync is available at the remote host you can do it old school:

tar --create --bzip2 --sparse --file - ~ | ssh user@remotehost "(cd
/destination/directory tar --extract --bzip2 --file -)"



--
Léa Gris - http://www.noiraude.net/
() Campagne du ruban texte brut contre les courriels en HTML,
/ contre les pièces jointes dans un format propriétaire.
Contre les DRMs appelez le : 09f911029d74e35bd84156c5635688c0


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-07-2008, 03:23 PM
Smoot Carl-Mitchell
 
Default Synchronize a directory over sftp

On Mon, 2008-01-07 at 17:00 +0100, Lea Gris wrote:

> If no rsync is available at the remote host you can do it old school:
>
> tar --create --bzip2 --sparse --file - ~ | ssh user@remotehost "(cd
> /destination/directory tar --extract --bzip2 --file -)"

Yep, assuming SSH is enabled on the remote server for the user account.
--
Smoot Carl-Mitchell
System/Network Architect
email: smoot@tic.com
cell: +1 602 421 9005
home: +1 480 922 7313

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-08-2008, 07:13 AM
Sundar Nagarajan
 
Default Synchronize a directory over sftp

Smoot Carl-Mitchell wrote:
> On Mon, 2008-01-07 at 17:00 +0100, Lea Gris wrote:
>
>> If no rsync is available at the remote host you can do it old school:
>>
>> tar --create --bzip2 --sparse --file - ~ | ssh user@remotehost "(cd
>> /destination/directory tar --extract --bzip2 --file -)"
>
> Yep, assuming SSH is enabled on the remote server for the user account.

I believe SFTP uses SSH, and without SSH being enabled on the remote
server, the OP wouldn't be able to use SFTP either. There may be ways of
disabling interactive login using SSH while permitting SFTP, but
technically, the (open)ssh layer is being used.

Regarding the OP's question, I would agree that rsync is a natural
option. If the remote system does not permit rsync, an indirect
workaround would be to use sshfs
(http://fuse.sourceforge.net/sshfs.html) which uses FUSE (should be
standard with recent Ubuntu versions) on the client. Then, once the
remote system ahs been mounted using sshfs, you can again use rsync.



--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-08-2008, 08:53 AM
Johan Sandberg
 
Default Synchronize a directory over sftp

Lea Gris skrev:
> Johan Sandberg a écrit :
>
>> Hi all,
>> I am trying to find a way to automatically (or manually) synchronize my
>> home directory to a sftp server. I have tried Unison, but it seems that
>> Unison can't handle sftp. Is there anyone out there that can help me
>> out? It does not have to have a nice GUI. A simple cli or shell script
>> would be equally handy (or handier).
>> BR
>> /Johan
>>
>>
>
> Rsync is done for that.
>
> rsync --times --delete-excluded --compress --recursive --progress ~
> user@remotehost:/destination/directory
Thanks! This was exactly what I was looking for. It works like a charm!

BR
/Johan

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-08-2008, 09:45 AM
andy baxter
 
Default Synchronize a directory over sftp

Smoot Carl-Mitchell wrote:
> On Mon, 2008-01-07 at 15:10 +0100, Lea Gris wrote:
>
>
>> Rsync is done for that.
>>
>> rsync --times --delete-excluded --compress --recursive --progress ~
>> user@remotehost:/destination/directory
>>
>
> Yep, rysnc is very handy and efficient for remote synchronization.
> However, the remote server may not let you use rsync.
>
lftp is very useful for stuff like this. You can use it in a command
line or prompt mode, and it has a 'mirror' command. it supports many
different protocols including sftp.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 10:21 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org