

$g_strlasterror = “unable to log in to FTP server, error reason. $g_strlasterror = “unable to connect to FTP server, error reason. Log (“linking to the specified FTP server ($FTP? Server)…”) #$g? Strlasterror indicates the reason for the last error: #$g ﹣ NIS allwavsfile ﹣ uploadsuccess indicates whether class a files have been uploaded completely. #$g ﹣ uploadsuccess indicates whether it has been uploaded completely. #$start date calculates the current start time #$skipped files is the number of skipped files #$processed “files is the number of uploaded files #$total “files is the number of uploaded files #=The first step of program execution: try to login FTP site=# Log (“auto upload FTP file version 0.1”) #Log file preparation for recording the whole process #A collection of strings indicating which types of files / folders will not be uploaded to the = (“_vti”,”.mdb”,”\\bak”,”\\data”,”server.inc”) #! remember: do not add “\ \” at the end of the = $cfg->val(‘SrcDirectory’, ‘src_dir_NamesListFile’) #Specify the folder named cross reference list file TXT, and place the named cross reference list file# #! remember: do not add “\ \” at the end of the = $cfg->val(‘SrcDirectory’, ‘src_dir_WAVFiles’)

#Specify the folder “voice files” to place all voice files to be uploaded# #! remember: do not add “/” at the end of the folder# $ftp_server = $cfg->val(‘FTPServer’, ‘ftp_server’) || ” #Read external parameters from configuration file# My $cfg = Config::IniFiles->new( -file => “nfig” ) #Module task: automatically upload all files under the specified folder to the specified directory of the specified FTP site according to the specified folder directory #Engineering project: FTP automatically upload two types of files Specify a class B folder to place class B files Parameter 6: SRC? Dir? Nameslistfile, which is an array: Note: subfolders in this directory will also be uploaded. Specify class a folder to place all voice files to be uploaded Parameter 5: SRC? Dir? Wavfiles, which is an array: In the “nfig” configuration file in the same directory as Perl script, there are six external parameters configured in advance: Config” file to configure the required important parameters. You can also use perl2exe (p2x-8.40-win32) to compile the Perl script into an EXE executable program and run the EXE in the scheduled task (this requires perlcrt.dll under the system path).īefore running, you must modify the “upload.
#Activeperl 5.8.4.810 windows#
PL” in the windows planning task, which requires configuring ActivePerl 5.8.4.810 in the windows environment You can configure the time to run “Perl upload. There are two ways to configure Perl script to run: Log”įile format: output the upload time, as well as the uploaded file name, its size and time consumed, and the failed file name and reason. Log”įile format: output upload time, as well as all uploaded file names and their sizes and time consumed.įailed: generating a log file named “upload fail 2005 01 04 17 23. Success: generate a log file named “upload ABCD succ ABCD 2005 ABCD 01 ABCD 17 ABCD 23. Step 3: if all class a files are uploaded successfully, look for the specified files under class B of the specified folder and upload them to the specified directory of FTPįinally, the format of the success / failure log to be written is as follows: The second step is to find the qualified files in the designated folder a, and upload the class a files to the designated directory of the FTP site The first step is to try to log in to the FTP site It only adds fault-tolerant response and reading external configuration files, and cuts out the reading and writing access files unrelated to general business logic. This Perl script is actually inherited from UWE Keim’s Perl script for uploading modified files to a FTP server,

The Perl file will perform the task of automatically uploading all files under the folder to the specified directory of the specified FTP site according to the specified folder directory. We put the main execution logic in the Perl source file, and the configuration file is nfig. Therefore, we have defined that this application depends on the operation of the following tools: Simplify the operation steps without introducing too much business logic, the simpler the requirements are, the better. Toolbox reuse: use existing tools as much as possible The basic concepts of this application design are:
