View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Slaven Rezić > WE_Framework-0.097_03 > WE_Frontend::Publish::FTP_MD5Sync



Annotate this POD

Module Version: 1.05   Source  


WE_Frontend::Publish::FTP_MD5Sync - publish with FTP using MD5 fingerprints


    use WE_Frontend::Main2;
    use WEsiteinfo qw($c);


    use WE_Frontend::Main;
    use WEsiteinfo;
    $WEsiteinfo::livetransport = "ftp-md5sync";



This refers to the old format (first name) or the new format (second name).

$livetransport or $c->staging->transport

The transport protocol should be set to "ftp-md5sync".

$liveuser or $c->staging->user

The remote FTP user.

$livepassword or $c->staging->password

The remote FTP password.

$livedirectory or $c->staging->directory

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.

$livehost or $c->staging->host

The remove host.

$pubhtmldir or $c->paths->pubhtmldir

The local htdocs directory.

$livecgidirectory or $c->staging->cgidirectory

If there are CGI programs to be published, the remote cgi directory have to be specified. The same rules as in $livedirectory apply.

@stagingextracgi or $c->project->stagingextracgi

An array reference with additional cgi scripts to be published.

$livestagingext or $c->staging->stagingext

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 WE_Framework as cgi-scripts/get_md5_list.cgi.


The top directory of the remote server. Here the real filesystem path should be used. In the example above, this would be /home/users/company.


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 deleteold.


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 livedirectory and livecgidirectory from the WEsiteinfo configuration.


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 chksum command.


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 @directories.


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 deleteold feature.


Slaven Rezic -


syntax highlighting: