Summary More info FAQ Downloads


Pushsite was originally developed to automate the process of keeping the files on my hosted website in sync with those on my machine over a dial-up connection. When I published Version 1, I was so overwhelmed for changes that I deceided a complete re-write was in order. See below for more details of the changes.

I'll try to keep the Freshmeat listing up to date. If you are unable to find www.freshmeat.net, or can't find pushsite on freshmeat.net, then contact me at the address supplied and I'll let you know where the current version is.

back to top


Pushsite is GPL - see COPYING for more info. It MUST be distributed with the files described listed in MANIFEST unmodified. Additional material should be added in a file called README.OEM and/or in a sub- directory called OEM.

If you find it useful, it would be nice to get an Email saying so (colinmckinnon@technologist.com).

back to top


README		(this document)
README.win32	(Docs for MS Windows 95/98/NT/...)
pushsite 	(the program)
pushsite.conf 	(sample config file for Unix/Linux/Posix)
		(sample config file for MS Windows 95/98/NT/...)
pushsite.1	(man page)
install.sh	(bash script to install program)
pushsite.faq	(faqs, of course!)

back to top


Version 2.6 C.McKinnon
Version 2.5 C.McKinnon, Demon Internet fix from Ian Macdonald, Passive fix from Robert Pearce
Version 2.4 C.McKinnon, Touch fix from Bruno Bzeznik
Version 2.3 C.McKinnon, Directories fix from Eddy Vervest
Version 2.0-2.2 written by C.McKinnon
Version 1.0 C.McKinnon, Andrew M. Bishop

back to top


Please note that any section marked [U] applies to Unix/Linux/Posix only. The instructions for Microsoft Windows are in a seperate file (README.win32)

Auto installation [U]

run install.sh and answer the questions - you need to know the name or address of the host to which you want to push files, and your username / password on thamachine, and, of course, the directory you want to push.

Note that you can run this script again in future to create new config files.

Manual Installation (recommended) [U]

Copy the executable to the location of your choice. I suggest /usr/local/bin unless you have reason to put it elsewhere. Copy the man page (pushsite.1) to the relevant man directory - /usr/local/man/man1. Read the man page, then edit the file pushsite.conf to reflect your settings. Test the config file by typing:

	pushsite -e -f yourconfigfile -vv
Finally, if there are no errors, copy this config file to /etc/pushsite.conf, or to ~/.pushsite.conf as appropriate.

back to top


Upgrading to 2.5

This should be backwardly compatible with earlier 2.X releases. The only significantdifference is the addition of the passive option (which should be disabled by default. To enable passive FTP, add the following line in your pushsite.conf file:

Note that if 'passive' is enabled by default on your server then this will actually turn it off.

Upgrading to 2.3a

This should be backward compatible with the other 2.x releases. The timestamped directory listing of the remote host is now called ls.$www - where $www is the hostname you set up in the conf file. The program will try to automatically update the file if required.

Upgrading to 2.0

Although this is a complete re-write of the program, it should be backwardly compatible with version 1.0. If you have a previous version of pushsite installed, then all your existing command line switches should work OK with this version. If you hard-coded any settings in the old version, then you'll need to enter these into the config file.

The control files have been renamed in version 2.0. If you don't wish to re-send your entire website then:

  1. ensure your remote site is up to date (NB the worst that can happen is that the file will be sent again and an error generated)
  2. cd to the root of your source tree
  3. rename the file ls-lR as ls.remote

back to top


(assuming you have set up your config file)

	pushsite -t
will give an indication of which files require updating - for more details use -v or -vv. If no files require upating, then the output will be blank.

will run an integrity check on the remote site, and update any files

When you run pushsite for the first time, you will likely get a lot of warnings about files on the remote system being newer than the last update - this is because, in the absence of any better information, the program will assume that the first update was in 1986.

Subsequent runs should behave better.

The program creates a file ls.local in the top of the directory tree you intend to push. It also creates one or more ls.$www (where $www is the name of the remote system). Do NOT delete these files - PushSite uses them for tracking when files were sent.

Please note that if your pushsite.conf file is within the directory tree sent to the remote system, then it will be pushed along with the other files! Any file beginning "ls." will NOT be sent unless it has an extension set up in $chkfiles in the config.

See the man page for more info.

back to top


Using ~/.netrc auto login

Keeping all your passwords in one (_secure_)place is probably a good idea. If you can automatically login to the remote site, then you may want to setup pushsite to use this facility. search for 'netrc' in the pushsite program (after backing it up!). Change the ftp command line in each of the 2 open() statements to the approriate syntax you would use when starting the program from a shell. Normally just deleting the -n switch from the line should fix this.

If there is sufficient demand I may make pushsite a bit smarter about auto-logins in a future version.

Illegal words

If you tell it to, PushSite will check files for particular strings. You need to tell PushSite

  1. which files to check
  2. what to check for
The former is achieved by specifying a regular expression in the config file $chkfiles. Here are some examples:
See man perlre for more info on Perl regular expressions

The "illegal word" is also a regular expression.

Please note that pushsite will send a file even if it contains illegal words. The reason for this is, that in many cases, not sending the file may be worse than sending a file with an incorrect link in it.

back to top

Dot files

e.g. .htaccess

By default PushSite ignores filenames beginning with a dot character. This can pose problems in some circumstances. While the next version will have a configuration option for this, in the meantime you will need to edit the program to change the four occurrences of ls -lR to ls -laR. These can be found in lines 53, 73, 530 and 531:

53 system('ls -laR >ls.local');
73 system('ls -laR >ls.local');
print "ftp> ls -laR ls.$www\n" if ($verbose==2);
print FTP "ls -laR ls.$www\n";

Known bugs

  1. Not strictly a bug, but pushsite is not aware if the ftp session it starts is not connected to the remote host. This should be evident from the STDOUT/STDERR. The exact message depends on your version of ftp e.g. when not connected to the internet I get the following on STDOUT:
    	ftp: connect: Network is unreachable
    	ftp: connect: Network is unreachable
  2. If I specified -vv on the command line then I would expect to see responses from the ftp server in the STDOUT (note that this output is buffered seperately from the output of pushsite which can cause some confusion as to the real order of events):
    	220 ftp.server.co.uk FTP server (Version wu-2.4.2-academ
    	[BETA-18](1) Mon Aug 3 19:17:20 EDT 1998) ready.
    	Remote system type is UNIX.
    	Using binary mode to transfer files. 

Reporting bugs

Please give an outline of the problem. If it runs at all, pushsite should generate 2 files at the top of the source directory tree:

- please send copies of these along with your pushsite.conf (edited to remove your password).

back to top


There are other programs which try to do the same task. a feature comparison is shown below:

back to top


20/1/2 Version 2.6 This version fixes the following issues
Date conversion bug - the billenium bug fix was flawed in its calculation of dates for files less than 6 months old from last year. As with the billenium bug the worst thing to happen was that bandwidth was wasted.
Single connection to FTP server. Formerly PushSite would connect once to collect the file list from the remote system, disconnect, then connect again if any updates were required. However some FTP server configurations would not allow two logons to the same account in such a short interval. PushSite now only connects once.
1/7/1 Version 2.5 This version fixes the following bugs
Billenium Bug! In several places a text comparison was performed in place of a numerical comparison. This caused mutiple files to be updated, thus squandering bandwidth!.
Previously any file in the source root directory beginning "ls." would have been sent to the remote system except for 'ls.local' and 'ls.$www' i.e. if you sent the same directory to multiple hosts then any mirror would get a directory listing from all the other mirrors.
Demon Internet changed their ftp server recently - the new one reports the root directory as ".:" whereas previously and on other systems there was no specific reference to the root.
The code has been updated to make it more portable - various flavours of the 'touch' program are now supported. It no longer requires the POSIX perl module. NB the changes mde may affect the internationalization of the program.
An option for passive FTP was added.
Version 2.4 was not released
18/6/00 Version 2.3 This version fixes the following bugs
Program does not create directory trees in correct order to accept files (previous workaround was to run multiple times)
install.sh and sample conf file amended to refer to $pass instead of $password
Size of directories not validated any more - dir files have different sizes on different filesystems
Program no longer confused by latyest version of gnu ls which lists current directory as . when ls -lR
Program holds seperate timestamps and directory listings for different remote hosts.
19/4/00 Version 2.2 This version fixes the following bugs:
Installation script not compatible with bash v2.0+ Program does not work if log recipient's Email address contains a '@'
Password stored in config file not recognized
5/4/00 Version 2.1 This version fixes the following bugs:
Password not always communicated to remote system
21/1/00 Version 2.0 This version fixes the following bugs:
Empty remote directory crash
Illegal word check failure
Multiple passes required to delete directories
Should now work with demon.co.uk
The following functionality has been added:
Various options for config files
Intrusion detection

back to top


Robert Thorsby
Kurt V. Hindenburg
Steve Quezadas
Jim Hague
Who all provided useful feedback and bug reports
Mary & AnnaTea, sympathy and patience

back to top