[ Content | View menu ]

shaftpup

sftpup – sha ftp uploader

sftpup is used for uploading files to ftp servers and keep them
consistent to a local directory.

Download sftpup: sftpup-6.

Usage

To use sftpup go follow these steps:

  1. Create a directory for your work, e.g. www where all files will
    be stored. For example, if you create your websites via XML and
    XSLT, make www the target for each generated file.
  2. Upload all files to the ftp server. Your server directory and www
    are now in a consistent state. sftpup saves the state of www by
    calculating SHA hashes for each file. To initialize, execute:

    sftpup --init <your-config-file>

    The hashes are stored in the file given by hashfile in
    <your-configfile>.

  3. If you change a file or directory (modified, deleted, added etc.)
    and want to do an update the ftp server, type:

    sftpup --update <your-config-file>

    sftpup compares www to the stored hashes and lists all
    differences. This list is then used to make send appropriate
    commands to the ftp server.

  4. To test what actions would be done, you can do a so called dry-run
    by typing:

    sftpup --dry-run <config>
    

    sftpup then prints a list of commands and files/directories.

Installation

You can use the Makefile that comes with sftpup. To do a standard
install, simply type make install. The program file will be copied
to /usr/local/bin, the man page to /usr/local/share/man/man1. To choose
a different directory, define PREFIX right before the Makefile target:

make PREFIX=/home/joe install

For a more specific installation, redefine BINDIR or MANDIR.

If you chose a non-standard installation directory, you must remember
the paths for the uninstall target:

make PREFIX=/home/joe uninstall

A standard uninstall goes like:

make uninstall

Configuration

The configuration for a server is stored in a configuration file with
the following syntax:

[project-name or alike]
server: [your-ftp-server]
port: [port number; optional]
user: [user-name]
passwd: [lalala; optional]
passive: [yes or no]
remotedir: [your directory on the server]
localdir: [your local directory, e.g. 'www']
hashfile: [where to store the hashes]

Take a look at the sample configuration file. If the passwd line is
not given, sftpup asks for a password at login. It is always risky
to store passwords ;-) The passive depends on the ftp server; yes
is default. Most servers use port 21, what is the default if port
is not given. You can use absolute or relative paths to the directories and the
hash file.

Requirements

sftpup is written in Python 2.2, but should run with newer versions. You can download an interpreter for many operating systems from the language homepage http://www.python.org.
Though sftpup was tested under Unix it should run with every Python
interpreter.

Why another program of this kind?

The only thing I wanted to do was: Create my websites via XML, store the
sources with CVS and upload only the modified files/directories (the
whole bunch of files is quite large).
sitecopy was the first program I tried out. The problem with it was
that if you deleted the directory with your files (like www above),
sitecopy thought all files must be uploaded again. This prevents a
make clean (remove all generated files) and CVS usage.
fmirror mirrors only files from a server, but I needed an upload way.
Additionally, most programs of this kind use the file timestamps, but
this can be a problem if you restore a backup or things like that.

sftpup uses the SHA message digest algorithm to compute a checksum for
each file to detect changes. This should be a better way to detect
changes.

Author

sftpup was written by Meik Teßmer <mtessmer@users.sourceforge.net>. If you
have questions, found bugs or want to contact me, send a message to the
email address above.  Carsten Grohmann committed two important patches.

License

Copyright (c) 2003-2008 Meik Teßmer
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
  notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above
  copyright notice, this list of conditions and the following
  disclaimer in the documentation and/or other materials
  provided with the distribution.

* Neither the name of MT. nor the names of its contributors may
  be used to endorse or promote products derived from this
  software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

No Comments

- TrackBack - RSS Comments