Results 1 to 4 of 4

Thread: FTP Sync using curlftpfs and Unison

  1. #1
    Join Date
    Nov 2006
    Beans
    4

    FTP Sync using curlftpfs and Unison

    I've been looking for a way to sync a local directory with an FTP location. I'm trying to replicate the way Dreamweaver can edit files locally, and then sync them later with an FTP server.

    After much searching, I thought I'd found a method - use curlftpfs to mount the FTP site as if it was a local folder, then use Unison to sync them. All went well in the setup, until I tried syncing from the REAL local folder to the mounted FTP folder.

    For the sake of clarity, here is a mock up of my setup:

    Real directory: /home/user/websites/mysite.com
    Mounted FTP dir: /home/user/ftpmount/mysite.com

    I can create/edit/delete files in both directories directly.
    If I edit a file, or delete one, in the mounted FTP dir, then run Unison, it will sync those files back to the local dir. Great. If I change a file in the FTP dir, then sync, it errors, with something like the following:

    Code:
    test.txt
    Error in copying locally:
    No such file or directory [open(/home/user/ftpmount/mysite.com/.unison.test.txt.840c8ac9c84ef4c6286a10b13833dcf4.unison.tmp)]
    Anyone see any obvious errors in what I've done, or have I been caught out by thinking I could get around Unison not supporting FTP by using curlftpfs?

    Thanks,

  2. #2
    Join Date
    Nov 2006
    Beans
    4

    Re: FTP Sync using curlftpfs and Unison

    Thought I'd reply with my own results... Not sure what I had done wrong, but after a couple of reboots the exact setup I had mentioned works fine, just very slowly.

    It has acceptable performance for a small site (or a sync of a subfolder in a site) over a good ftp link.

  3. #3
    Join Date
    Feb 2010
    Beans
    8

    Wink Re: FTP Sync using curlftpfs and Unison

    Great tutorial........ It rocks


    For beginners heres how to set
    CurlFtpFS


    First of all you need to install CurlFtpFS, which in case of Ubuntu or Debian based operating system is to run
    Code:
    sudo apt-get install curlftpfs
    Assuming you've successfully installed curlftpfs, all you need to do in order to mount ftp locally is to to run these commands.
    Code:
    mkdir hostr
    Code:
    sudo curlftpfs -o allow_other ftp://user:pass@ftp.example.com hostr
    user*** is the username and password to log into ftp account.
    and dir hostr is the host point.


    After that, you can change your working directory to the mount-point and use the regular unix utilities to work on the files that normally accessible on the FTP protocol. After you're done, you can unmount it by running the usual "sudo umount [mountpoint]" command.


    This will b enough for CurlFtpFS. now your ftp folder will as a local folder.


    Installing and using unison

    Unison can be found in Ubuntu's Universe software repository, in the unison package. Many users will also want the unison-gtk package as well for a GTK GUI. See InstallingSoftware for information about installing software, and Repositories if you need help enabling Universe.

    GUI usage

    Unison includes a GUI interface that allows you to graphically work with the application. You can access it by going to Applications -> Accessories -> Unison or by pressing Alt+F2 and typing unison.

    thanks for reading..







  4. #4
    Join Date
    Feb 2008
    Beans
    102

    Cool Re: FTP Sync using curlftpfs and Unison

    hello sextheorist,


    seems that i'm un-aware of something here.
    I did what u suggest for mounting them in.
    And yes it works.

    It just like,... hmmmmph.
    The problem occured when I tried to copy or move some files
    to or from it. It will generate Input / Output Error something like that. is there anyone encountered it as well?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •