mtWeb  Home > Download > SiteSync - Synchronizes sites throught FTPSitemap  Search

SiteSync - Synchronizes sites throught FTP

Posted by martin on 10 Jan 2002, last updated on 5 Nov 2002.

A Python script for synchronization of a remote directory structure from a local one via the FTP protocol.

Features

  • Saves network bandwidth by uploading only those files that are modified
  • Supports multiple servers with different content
  • Supports alternative local directories allowing you to share the rc file between Unix and Windows

Download

sitesync.py, downloaded 2223 times.
Python source code

Changelog

12 Jan 2004

  • Apply binary fix for Windows

5 Nov 2002

  • Handle non-existing local directory or directories

27 Sep 2002

  • Multiple ignore matches support (Note: Run control syntax change)
  • Strip leading slash that was confusing some FTP servers
  • Print number of ignored files

5 Aug 2002

  • Run control file syntax change
  • Re-ordering of files to upload first and then delete
  • Support for FTP servers that don't set your home to /

1 Aug 2002

  • Added ignore support

5 Jul 2002

  • Rewrite of the code - it now handles almost all errors and every function is documented

25 Jun 2002

  • Alternative local directories are available - the first that exists will be used, this allows sharing the same run control file between Linux and Windows

21 Jun 2002

  • Added support for user break on long updates, all uploads will be marked

1 Jun 2002

  • Fixed the non initialized filelist bug for multiple hosts
  • The code is now Windows compatible, tested on Windows 2000
  • One more change in the run control file, you are OK with the new version if you change /../ to *

14 Apr 2002

  • Better handling of missing netrc file

16 Mar 2002

  • Renamed to SiteSync
  • Automatic local directory rescanning

2 Mar 2002

  • Run config file syntax change
  • Fixed change directory problem when the first file was in the root one
  • Set all files to uploaded state option
  • Print number of files that need uploading and deleting and do not connect to the server if both are zero

25 Feb 2002

  • Full ~/.netrc write support
  • Manual directory rescanning
  • Delete files support

20 Feb 2002

  • Added support for arbitrary level nested diretories
  • Added create directory support, if it does not exist on the server
  • Removed the rc-file password & username saving in favour of a ~/.netrc file

10 Jan 2002

  • First released

Comments

Windows
by martin on 13 Jun 2002 8:34pm GMT

Unfortunately the script sometimes fails to upload binary files on Windows.

If anybody's willing to do some extensive testing I would really appreciate that. Thanks.

RC file
by dave (dschulze@fls-inc.com) on 3 Mar 2003 11:41pm GMT

Your script looks very promising. Can you make some sample .rc files available to help me out? BTW, I'll be trying this with binary files on Windows, so I can test for you. Thanks.

sitecopy
by FaceOff (contact@jenskleikamp.de) on 12 Mar 2003 3:06pm GMT

sitecopy

Great Script!
by dirk () on 13 Mar 2003 7:47pm GMT

It works on windows for me.

Found the binary error
by DirkK () on 14 Mar 2003 7:56pm GMT

Hi,

you have to change this line:

self.ftp.storbinary('STOR ' + filename, open(self.local_dir + file, 'r'))

to this line:

self.ftp.storbinary('STOR ' + filename, open(self.local_dir + file, 'rb'))

to make it work on Windows (means: open the files in binary mode by appending the 'b').

Regards,

Dirk

ftp through proxy
by x-herbert (i.steinhardt@web.de) on 7 Apr 2003 9:27am GMT

Hi,

how can I upload a file behind a firewall/proxy??

Regads

x-herbert

file starting with dot
by tbob () on 9 Sep 2004 6:30pm GMT

Hi,

for those who can find this useful: on my XP machine I need to rename in the script source .sitesync and .netrc into sitesync and netrc to get the script to work.

Regards

tBob