berlinfert.blogg.se

Filewatcher ftp 2018
Filewatcher ftp 2018











filewatcher ftp 2018

$sftp->backup("./folder") #backup to folder Sets or returns the backup folder property. $sftp->match(undef) #reset to default - all files backup Regular Expression to match file names for the next iterator $sftp->match(qr/\Aremote_file\.zip\Z/) #exact file Note: Some SFTP servers put clients in a change rooted environment. $sftp->options() #defaultįolder on remote SFTP server. SSH options passed to the more property of Net::SFTP::Foreign as an array reference. SFTP port number (defaults to undef not passed through) $sftp->port(undef) #default options SFTP user name (defaults to current user) $sftp->user(undef) #default port The upload method is a simple wrapper around Net::SFTP::Foreign->mput that is parallel to download. $sftp->upload('local_file1.zip', 'local_file2.zip') $sftp->folder("/remote_folder") #or set on construction Uploads file to the folder and returns the count of uploaded files. Note: List is shifted for each call to next method upload Returns list of filenames remaining to be processed that match the folder and regular expression my $file = $sftp->next or exit #get file or exit Returns a Path::Class::File object or undef if there are no more files. My $file = $sftp->download('/remote_folder', 'remote_file.zip') # which isa Path::Class::File object with an extract method nextĭownloads the next file in list and saves it locally to a temporary folder. my $file = $sftp->download('remote_file.zip') #isa Net::SFTP::Foreign::Tempdir::Extract::File File /tmp/hwY9jVeYo3/file1.zip is a Net::SFTP::Foreign::Tempdir::Extract::Fileįile /tmp/ytWaYdPXuD/file2.zip is a Net::SFTP::Foreign::Tempdir::Extract::Fileįile /tmp/JrsrkleBOy/file3.zip is a Net::SFTP::Foreign::Tempdir::Extract::File CONSTRUCTOR new METHODS downloadĭownloads the named file in the folder. Printf "File %s is a %s\n", "$file", ref($file) This is a typical subclass implementation for a particular infrastructure Print "$file" #process file here Subclass My $file = $sftp->next or exit #nothing to process so exit This is a simple file watcher implementation use Net::SFTP::Foreign::Tempdir::Extract My $file = $sftp->download($remote_folder, $remote_filename) File Watcher My $sftp = Net::SFTP::Foreign::Tempdir::Extract->new(host=>$remote_host, user=>$remote_user) This is a simple file downloader implementation use Net::SFTP::Foreign::Tempdir::Extract This package assume SSH keys are correctly installed on local account and remote server. Secure FTP client which downloads files locally to a temp directory for operations and automatically cleans up all temp files after variables are out of scope. My $sftp = Net::SFTP::Foreign::Tempdir::Extract->new(īackup => './backup', #default is not to backup

Filewatcher ftp 2018 archive#

Net::SFTP::Foreign::Tempdir::Extract - Secure FTP client integrating Path::Class, Tempdir, and Archive Extraction SYNOPSIS use Net::SFTP::Foreign::Tempdir::Extract













Filewatcher ftp 2018