LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-26-2011, 08:01 PM   #1
JamesGT
Member
 
Registered: Oct 2009
Location: St. Louis, MO, USA
Distribution: Slackware64 Live
Posts: 300

Rep: Reputation: 51
Sync a local folder with one on a webserver?


What would be the easiest way to synchronize a local folder of images, recursively through sub-folders, with a remote folder of images over FTP?

Last edited by JamesGT; 02-26-2011 at 08:19 PM.
 
Old 02-26-2011, 08:55 PM   #2
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
A few possibilities. The best way in my opinion is to use something like curlftpfs to mount the FTP share to a local folder and then rsync to that folder. However, even with adequate timeout options, some FTP servers are not reliable enough for this approach and you end up having to run rsync multiple times and hope that it finishes eventually. Another option is to just use lftp (and use the `mirror -R` options to reverse mirror...and you may be able to mix that with the -n option to only copy newer files depending on how you store them locally). lftp establishes the connection for each file transferred so reliability is not much of a concern (unlike the first approach). I've also heard of sitecopy but I haven't tried it myself (I just use lftp).
 
1 members found this post helpful.
Old 02-27-2011, 08:01 AM   #3
DonnieP
Member
 
Registered: Jan 2008
Location: Richmond, VA USA
Distribution: Slackware
Posts: 144

Rep: Reputation: 29
I use lftp with the mirror and mirror -R options to sync music between my phone and my hard disk.
 
1 members found this post helpful.
Old 02-27-2011, 12:27 PM   #4
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
Yep lftp mirror command is pretty great at this.

mirror -n remotedir localdir (for keeping local in sync with remote)
mirror -Rn localdir remotedir (for keeping remote in sync with local)

The -n flag only updates newer files so you don't end up uploading the same content again and again.

Last edited by dive; 02-27-2011 at 02:16 PM.
 
Old 02-27-2011, 12:46 PM   #5
JamesGT
Member
 
Registered: Oct 2009
Location: St. Louis, MO, USA
Distribution: Slackware64 Live
Posts: 300

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by dive View Post
Yep lftp mirror command is pretty great at this.

mirror -n remotedir localdir (for keeping local in sync with remote)
mirror -Rn remotedir localdir (for keeping remote in sync with local)

The -n flag only updates newer files so you don't end up uploading the same content again and again.

Will this also delete files on the remote if I delete them locally?
 
Old 02-27-2011, 02:13 PM   #6
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
Quote:
Originally Posted by JamesGT View Post
Will this also delete files on the remote if I delete them locally?
You need extra flags for that. Best thing is to read man lftp and look for the mirror options (there are a lot)

Code:
 -e, --delete             delete files not present at remote site
Ah noticed my mistake in my first post. Should be:

mirror -Rn localdir remotedir (for keeping remote in sync with local)

With -R you switch around local/remote

Last edited by dive; 02-27-2011 at 02:17 PM.
 
Old 03-13-2011, 04:54 PM   #7
JamesGT
Member
 
Registered: Oct 2009
Location: St. Louis, MO, USA
Distribution: Slackware64 Live
Posts: 300

Original Poster
Rep: Reputation: 51
LFTP worked great! Pretty easy to use, did what it was supposed to.
 
Old 05-21-2011, 12:36 AM   #8
xgreen
Member
 
Registered: Aug 2003
Distribution: Slackware,Arch
Posts: 389

Rep: Reputation: 30
hi all,

I'm using lftp & it works great except I've issue with file ownership. It seems that lftp does not keep the original ownership. any option that I've missed?
 
  


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
[SOLVED] Sync web folders with local folder lpallard Linux - Software 3 05-14-2010 03:24 PM
Sync Time Database server with the webserver sinister1 Linux - Server 3 01-22-2009 07:02 AM
how can i add a local Folder on local Hard Disk as Yum Repository ?? vahid_p Fedora 4 02-22-2007 10:43 AM
Local webserver -- How to deny all client install their local web server--Please help b:z Linux - Networking 13 04-16-2005 07:11 PM
Where is the data folder for webserver? helpme0904 Linux - General 1 11-03-2004 08:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:30 AM.

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