WE_Frontend::Publish::FTP_MD5Sync - publish with FTP using MD5 fingerprints
use WE_Frontend::Main2; use WEsiteinfo qw($c); $c->staging->transport("ftp-md5sync"); $main->publish;
use WE_Frontend::Main; use WEsiteinfo; $WEsiteinfo::livetransport = "ftp-md5sync"; $main->publish;
This refers to the old format (first name) or the new format (second name).
The transport protocol should be set to "ftp-md5sync".
The remote FTP user.
The remote FTP password.
The remote FTP directory. This is not the real filesystem path on the remote host, but the virtual FTP path. For example: the real filesystem path may be somthing like
/home/users/company, but if you login to the server as
company, you will see
/ as the FTP root path.
If the FTP root is
/, the value of
$livedirectory should be an empty string.
The remove host.
The local htdocs directory.
If there are CGI programs to be published, the remote cgi directory have to be specified. The same rules as in
An array reference with additional cgi scripts to be published.
A hash reference with additional attributes:
If set to a true value, then do not execute the FTP commands, just show them.
The remote CGI script to create the MD5 list. The script is included in the
The top directory of the remote server. Here the real filesystem path should be used. In the example above, this would be
If true, then outdated remote files (not existing on the local side) are deleted.
If true, then outdated remote files will be moved to the
trashdirectory. Cannot be used together with
The FTP directory name of a trash directory. Have to be defined if
movetotrash is set.
The CGI script
get_md5_list.cgi is configured by creating a perl file called
get_md5_list.cgi.config which should reside in the same directory as the CGI script. The following perl variables may be set as configuration variables:
A list of directories for which the MD5 fingerprints should be collected. Normally these are
livecgidirectory from the
Specify a list with the preferred methods to get the MD5 digest. This does not need to be set;
get_md5_list.cgi is smart enough to get a supported method automatically. Permitted values are:
Use the perl module Digest::MD5.
Use the (old) perl module MD5.
Use the OS command
md5 (BSD systems).
Use the OS command
md5sum (Linux and Solaris systems).
Use the pure perl module Digest::Perl::MD5.
Use the obsolete
Just stat the file and use the modification time of the file.
A list of files to be excluded. The check will be done against the partial filename, beginning at the paths as in
Per-directory (as in
@directories) exclude list. For example, if
@directories = ("/home/htdocs", "/home/htdocs/cgi-bin");
is specified, then
%exclude may be
%exclude = ("/home/htdocs" => ['.htaccess', 'cgi-bin/.*'], "/home/htdocs/cgi-bin" => ['mails.*']);
Note that it is generally problematic to have subdirs specified in
@directories --- in such a case the
%exclude variable should be set cleverly.
Be verbose if set to a true value. The messages are printed to STDERR. Note that some servers do not like output to STDERR --- it will get mixed up with STDOUT output.
There are still some problems with this module. Be especially careful if using the
Slaven Rezic - email@example.com