GithubHelp home page GithubHelp logo

ftpsync2d's Introduction

#ftpsync2d

This project provides a tool to synchronize remote FTP and local directory trees in both directions. The tool is provided as a Python script (ftpsync.py) that can be useful for uploading new/modified files to a homepage host using FTP. The tool can also be used to download new/modified files (such as wiki pages) for backup or mirroring purposes.

In both usage cases, the tool requires write access to FTP server to create .listing files that are used to accelerate the synchronization process. It is also possible to export files to a remote directory without .listing files.

##Download and installation

You can download the python script ftpsync.py from here. For installation, just copy the file to a directory that is in the PATH environment variable and make it executable (e.g. chmod +x ftpsync.py).

##Usage

To learn about the options of the ftpsync.py script, run

sh> ftpsync.py --help

that will display

Usage: ftpsync.py [options] <remote path> <local path>

 ftpsync.py is tool to synchronize remote and local directory trees using FTP
protocol (see http://ftpsync2d.googlecode.com/ for updates). Both directions
are supported. Write access to FTP server is required.  To skip processing
remote directories that one does not have read or write access, use --skip
option. When a new file was added to FTP server by other means than using
ftpsync.py, use --listing to update .listing files.  Remote path must be given
in the following form: [ftp://][username[:password]@]hostname[<remote
directory>]

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -u, --upload          enable uploading files
  -d, --download        enable downloading files
  -s SKIP_PATH, --skip=SKIP_PATH
                        skip listing specified remote (absolute) path
  -l, --listing         update remote .listing files
  -r REMOVE_PATHS, --remove=REMOVE_PATHS
                        remove specified files and directories
  -e, --export          only file export, no .listing files; will override all
                        functions modifying or creating .listing files

For example, to syncronize remote directory rdir in the FTP server ftp.example.com with the local directory ldir, run

ftpsync.py ftp://ftp.example.com/rdir ldir --download

When username and password is required, the script will ask. When there are files that are changed locally and should be uploaded, add --upload option to the command line.

####Important note

Before using ftpsync.py, backing up data is highly recommended.

##Feedback

Bug reports and feature requests should be reported to ftpsync2d issues.

##License New BSD License

##Credits Originally developed by Pearu Peterson. Exported from http://code.google.com/p/ftpsync2d with permission.

ftpsync2d's People

Contributors

mehmandarov avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

ftpsync2d's Issues

Creation of remote path on Windows

What steps will reproduce the problem?
1. be on Windows
2. start a synchronization

What is the expected output? What do you see instead?
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "disk\ftpsync.py", line 668, in main
    session = FtpSession(remote_path)
  File "disk\ftpsync.py", line 546, in __init__
    assert remote_path.startswith('/'),`remote_path`
AssertionError: '\\dirtosync'

What version of the product are you using? On what operating system?
Version 1.1-svn on Windows XP SP3

Please provide any additional information below.
I wrote here to try this feature of Google Code! :-)

Original issue reported on code.google.com by [email protected] on 5 Jan 2009 at 11:07

Launch client on Windows (Server is Linux)

Hi,

I had problems running the client on windows, so I have made some modifications 
to it. Mainly to handle the client side path separator correctly.

Check it and merge it if you want. There is no problems existing, so I only 
create this ticket to share the code for you.

Other: I plan to modify the whole function to be able to follow server side 
changes fluently. That means to store the .listing files locally and use the 
"MDTM" stuff only when the files are changed on both sides (conflicts). But 
those are bigger changes.

Brgds,
Viktor

Original issue reported on code.google.com by [email protected] on 26 Jun 2010 at 8:27

Attachments:

Problem uploading files with ":" in the filename

When I'm running the script to sync a folder with one or more filenames 
with colon in it.

For example: 
photos/album1:picture1.jpg
photos/album1:picture2.jpg
photos/album2:picture1.jpg

The script raises an exception saying that the a lambda function should 
receive 2 arguments but is receiving 3 instead.
It happens because there is a split(":") to get the file size for each one 
of the lines which break the filename in the middle.

This is happening in the version 1.0 but in a quick check in the SVN 
version seems to have the same problem.

The fix I'm using is replace the split by a rsplit with a limit of 1 as 
follow:

- return dict([func(*line.rsplit(':', 1)) for line in l.splitlines()])
+ return dict([func(*line.split(':')) for line in l.splitlines()])

Let me know if you need any further info.

Original issue reported on code.google.com by seocam on 23 Feb 2010 at 5:46

New option to remove files while uploading

Hi guys, thanks for this script! I'm using it and it's being really helpful in 
my project.
I just wanted to give you my own version in which I added an option to use for 
removing files at FTP which are no longer present on your local machine.
You need to use it with the --upload option to perform  deletions.
Just wanted to share with you in case it could help anybody else.
Barbara

Original issue reported on code.google.com by [email protected] on 30 Jan 2014 at 7:57

Attachments:

Example

Hello,

your example "ftpsync.py ftp://ftp.example.com/rdir ldir --download" gives an 
assertion error.  I just cant work out in what format the login and folder 
details need to be put. Could you give an example with user name and password 
please.

Cheers

Original issue reported on code.google.com by [email protected] on 25 Oct 2011 at 11:38

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.