NAME
Net::DownloadMirror - Perl extension for mirroring a remote location via FTP to the local directory
SYNOPSIS
use Net::DownloadMirror;
my $um = Net::DownloadMirror->new(
ftpserver => "my_ftp.hostname.com",
usr => "my_ftp_usr_name",
pass => "my_ftp_password",
);
$um->Update();
or more detailed
my $md = Net::DownloadMirror->new(
ftpserver => "my_ftp.hostname.com",
usr => "my_ftp_usr_name",
pass => "my_ftp_password",
localdir => "home/nameA/homepageA",
remotedir => "public",
debug => 1 # 1 for yes, 0 for no
timeout => 60 # default 30
delete => "enable" # default "disabled"
connection => $ftp_object, # default undef
# "exclusions" default empty arrayreferences []
exclusions => ["private.txt", "Thumbs.db", ".sys", ".log"],
# "subset" default empty arrayreferences [ ]
subset => [".txt, ".pl", ".html", "htm", ".gif", ".jpg", ".css", ".js", ".png"],
# or substrings in pathnames
# exclusions => ["psw", "forbidden_code"]
# subset => ["name", "my_files"]
# or you can use regular expressions
# exclusinos => [qr/SYSTEM/i, $regex]
# subset => {qr/(?i:HOME)(?i:PAGE)?/, $regex]
file_name => "modified_times",
);
$um->Update();
DESCRIPTION
This module is for mirroring a remote location to a local directory via FTP. For example websites, documentations or developmentstuff which ones were uploaded or changed in the net. It is not developt for mirroring large archivs. But there are not in principle any limits.
Constructor and Initialization
- (object)new(options) Net::DownloadMirror is a derived class from Net::MirrorDir. For detailed information about constructor or options read the documentation of Net::MirrorDir.
methods
- (1)_Init(%arg) This function is called by the constructor. You do not need to call this function by yourself.
- (1|0)Update(void) Call this function for mirroring automatically, recommended!!!
- (ref_hash_modified_files)CheckIfModified(ref_list_local_files) Takes a hashreference of remoe filenames to compare the last modification time, which is stored in a file, named by the attribute "filename", while uploading. Returns a reference of a list.
- (1|0)StoreFiles(ref_array_paths) Takes a arrayreference of remote-paths to download via FTP.
- (1|0)MakeDirs(ref_array_paths) Takes a arrayreference of directories to make in the local directory.
- (1|0)DeleteFiles(ref_array_paths) Takes a arrayreference of files to delete in the local directory.
- (1|0)RemoveDirs(ref_array_paths) Takes a arrayreference of directories to remove in the local directory.
optional optiones
- file_name The name of the file in which the last modified times will be stored. default = "lastmodified_remote"
-
=item delete When directories or files are to be deleted = "enable" default = "disabled"
EXPORT
None by default.
SEE ALSO
Net::MirrorDir Net::UploadMirror Tk::Mirror http://www.planet-interkom.de/t.knorr/index.html
FILES
Net::MirrorDir Storable File::Basename File::Path
BUGS
Maybe you'll find some. Let me know.
REPORTING BUGS
When reporting bugs/problems please include as much information as possible.
AUTHOR
Torsten Knorr, <create-soft@tiscali.de>
COPYRIGHT AND LICENSE
Copyright (C) 2006 - 2008 by Torsten Knorr
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.9.2 or, at your option, any later version of Perl 5 you may have available.
6 POD Errors
The following errors were encountered while parsing the POD:
- Around line 242:
'=item' outside of any '=over'
- Around line 247:
You forgot a '=back' before '=head2'
- Around line 249:
'=item' outside of any '=over'
- Around line 273:
You forgot a '=back' before '=head2'
- Around line 275:
'=item' outside of any '=over'
- Around line 283:
You forgot a '=back' before '=head2'