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;
or
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.
/home/users/company
company
/
If the FTP root is /, the value of $livedirectory should be an empty string.
$livedirectory
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 $livedirectory apply.
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 WE_Framework as cgi-scripts/get_md5_list.cgi.
WE_Framework
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.
trashdirectory
deleteold
The FTP directory name of a trash directory. Have to be defined if movetotrash is set.
movetotrash
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:
get_md5_list.cgi
get_md5_list.cgi.config
A list of directories for which the MD5 fingerprints should be collected. Normally these are livedirectory and livecgidirectory from the WEsiteinfo configuration.
livedirectory
livecgidirectory
WEsiteinfo
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).
md5
Use the OS command md5sum (Linux and Solaris systems).
md5sum
Use the pure perl module Digest::Perl::MD5.
Use the obsolete chksum command.
chksum
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.
@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
%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 - slaven@rezic.de
To install WE::DB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WE::DB
CPAN shell
perl -MCPAN -e shell install WE::DB
For more information on module installation, please visit the detailed CPAN module installation guide.