Pakiet: com.suncode.plugin.ftp.task.DownloadFilesFromFTPTask

Kategoria: FTP

Dostępna od wersji: 1.0.1

Poprawna konfiguracja połączenia z serwerem FTP. W zakładce Konfiguracja wtyczek

Zadanie pobiera najnowsze pliki z serwera FTP do katalogu lokalnego. Pliki mogą być nadpisywane lub dodane jako nowe ze zmienioną nazwą. Zadania umożliwia także skasowanie pobranych plików z serwera FTP pod warunkiem, że użytkownik (którym się logujemy) posiada do tego uprawnienia. Pobierane są tylko pliki z danego katalogu na serwerze (nie są przeszukiwane ani pobierane katalogi). Zadanie po pobraniu plików zapisuję w bazie lokalnej najnowszą datę zmodyfikowanego pliku na serwerze FTP i następne odpalenie zadania pobiera nowsze pliki od tej daty. Aby pobrać pliki z wcześniejszą datą, należy zmodyfikować wpis w tabeli w bazie danych przed uruchomieniem tego zadania.

Nazwa parametruod wersjiOpisTyp parametruUwagi i ograniczenia
Plik konfiguracyjny1.0.1Nazwa pliku konfiguracyjnego pochodząca z panelu wtyczki zarządzania konfiguracjami wtyczek, w którym znajdują się informacje konfiguracyjne dotyczące połączenia z serwerem.TekstOpis Wtyczki i konfiguracji połączenia FTP
Katalog FTP1.0.1Ścieżka do katalogu na serwerze FTP, z którego będą pobierane pliki. Podkatalogi są ignorowane.Tekst 
Katalog lokalny1.0.1Ścieżka do katalogu lokalnego, do którego będą zapisywane pobrane dokumenty z serwera FTP.Tekst 
Usuń pobrane pliki z serwera FTP1.0.1true - Usuwa pliki na serwerze FTP po ich pobraniu. Jeżeli użytkownik ma takie uprawnienia. false - pliki zostają na serwerze FTP.LogicznyUsuwa gdy plik zostanie poprawnie pobrany, oraz użytkownik ma uprawnienia do usuwania dokumentów na serwerze FTP.
Nadpisz istniejące pliki1.0.1true - Nadpisuje istniejące pliki na dysku lokalnym. false- Jeżeli dany plik znajduję się na dysku, to dopisuję cyfrę na końcu w nazwie pliku.LogicznyW sytuacji, gdy pobieramy dokumenty które już znajdują się w katalogu lokalnym, to (jeżeli parametr "Nadpisz istniejące pliki" ustawiony jest na false) zostaną one zapisane z kolejnymi numerami w nazwie np. plik.txt, plik (1).txt, plik (2).txt, plik (3).txt.
Kolumnaod wersjiOpisTyp kolumnyUwagi i ograniczenia
id1.0.1Klucz główny tabeliLiczbowyAutomatyczne generowanie wartości
task_id1.0.1Identyfikator zadania zaplanowanegoLiczbowyWartość unikalna, brak nuli
task_name1.0.1Nazwa zadania zaplanowanegoTekstowyAktualizowana wraz z aktualizacją daty
last_modification_time1.0.1Data modyfikacji najnowszego pliku pobranego na serwer lokalnytimestampPobierane będą wszystkie pliki serwera ftp które mają późniejszą datę od tej

Przykład Zadania zaplanowanego

Przykład tabeli pm_plusftp_modification_time w bazie danych

1.0.1 (obowiązująca dokumentacja)

  • Utworzenie zadania zaplanowanego

Package: com.suncode.plugin.ftp.task.DownloadFilesFromFTPTask

Category: FTP

Available from version: 1.0.1

Correct configuration of the connection with the FTP server. On the Plug-in configuration tab

The job downloads the latest files from the FTP server to a local directory. Files can be overwritten or added as new files with a changed name. Tasks also allows you to delete downloaded files from the FTP server, provided that the user (which you are logging in to) has the right to do so. Only files in a given directory on the server are downloaded (directories are not searched or downloaded). After downloading the files, the task saves the latest date of the modified file on the FTP server in the local database and the next task firing downloads newer files from that date. If you want to retrieve files with an earlier date, you must edit the table entry in the database before running this task.

Parameter namefrom versionDescriptionThe type of the parameterNotes and Restrictions
Configuration file1.0.1
The name of the configuration file from the plug-in configuration management plug-in panel, which contains configuration information regarding the connection to the server.
StringDescription of the Plug and FTP connection configuration
FTP directory1.0.1Path to the directory on the FTP server from which the files will be downloaded. Subdirectories are ignored.String 
Local directory1.0.1Path to the local directory where documents downloaded from the FTP server will be saved.String 
Delete the downloaded files from the FTP server1.0.1true - Deletes files on the FTP server after downloading them. If the user has such rights. false - files remain on the FTP server.BooleanDeletes when the file is successfully downloaded and the user has permission to delete documents on the FTP server.
Overwrite existing files1.0.1true - Overwrite existing files on local disk. false- If the given file is on the disk, I add a number to the end in the name of the file.BooleanWhen we download documents that are already in the local directory, then (if the "Overwrite existing files" parameter is set to false) they will be saved with consecutive numbers in the name, e.g. file.txt, file (1) .txt, file (2) .txt, (3) .txt file.
Columnfrom versionDescriptionColumn typeNotes and Restrictions
id1.0.1The primary key of the tableLiczbowyAutomatic value generation
task_id1.0.1Scheduled task IDLiczbowyUnique value, no nulls
task_name1.0.1Scheduled task nameTekstowyUpdated with the date update
last_modification_time1.0.1Modified date of the most recent file downloaded to the local servertimestampAll ftp server files that have a later date than this will be downloaded

 

 

An example of a Scheduled Task

Example of pm_plusftp_modification_time table in database

1.0.1 (applicable documentation)

  • Create a scheduled task