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ą. Zadanie 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.1

Nazwa pliku konfiguracyjnego pochodząca z panelu wtyczki zarządzania konfiguracjami wtyczek, w którym znajdują się informacje konfiguracyjne dotyczące połączenia z serwerem.

UWAGA: Zmiana nazwy pliku konfiguracyjnego wpływa na datę od której będą pobierane dokumenty. W przypadku nowej konfiguracji, zostaną pobrane wszystkie pliki z serwera. W przypadku konfiguracji, którą wcześniej była używana w tym zadaniu, zostaną pobrane pliki od daty ostatniego uruchomienia w ramach wskazanej konfiguracji. Drugim kluczem wpływającym na datę jest id zadania zaplanowanego (każde zadanie posiada swój osobny kalendarz). Innymi słowy kolumny task_id oraz config_id stanowią klucz złożony w tabeli.

TekstOpis Wtyczki i konfiguracji połączenia FTP
Ścieżka do katalogu1.0.1Ścieżka do katalogu na serwerze, 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
config_id1.0.8Nazwa pliku konfiguracyjnegoTekstowy 

Przykład Zadania zaplanowanego

Przykład tabeli pm_plusftp_modification_time w bazie danych

1.0.1 (obowiązująca dokumentacja)

  • Utworzenie zadania zaplanowanego

1.0.6

  • Dodatnie asercji sprawdzającej istnienie katalogu na serwerze

1.0.7 (obowiązująca dokumentacja)

  • Dodatnie kolumny config_id do tabeli w bazie danych

1.0.8

  • Usunięcie wymagalności NOT NULL z kolumny config_id w tabeli pm_plusftp_modification_time. Naprawa niedziałającego upgradera.

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.

NOTE: Changing the name of the configuration file affects the date from which documents will be downloaded. In the case of a new configuration, all files from the server will be downloaded. For a configuration that was previously used in this task, files will be downloaded from the last run date under the specified configuration. The second key affecting the date is the scheduled task id (each task has its own calendar). In other words, the task_id and config_id columns are a composite key in the table.

StringDescription of the Plug and FTP connection configuration
Path to directory1.0.1Path to the directory on the 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

1.0.6

  • adding an assertion to check the existence of a directory on the server

1.0.7 (applicable documentation)

  • Adding a config_id column in pm_plusftp_modification_time table.

1.0.8

  • Removing NOT NULL constraint from config_id column in pm_plusftp_modification_time table. Fixing broken upgrader.