downloading multiple files with ftp
search cancel

downloading multiple files with ftp

book

Article ID: 240515

calendar_today

Updated On:

Products

Autosys Workload Automation

Issue/Introduction

Hi,

This is regarding ftp job.

We have day-to-day operations where file name changes daily....something like YYYYMMDD_file.txt (20220426_file.txt, 20220427_file.txt) which will be changing daily that needs to be downloaded. But I don't see this can be done after looking thru the autosys documentation.

https://techdocs.broadcom.com/us/en/ca-enterprise-software/intelligent-automation/autosys-workload-automation/12-0-01/reference/ae-job-information-language/jil-job-definitions/ftp-local-name-attribute-specify-local-filenames-within-an-ftp-job.html

is there a way to specify remote file like this...ftp_remote_name: 202204*_file.txt

and download location "ftp_local_name: /home/testuser/" so that it keeps all the file name?

Thanks.

insert_job: Test_FTPS_Ndrive    job_type: ftp
machine: <machine name>
owner: user123@CORP
application: Test-Python1
alarm_if_fail: y
alarm_if_terminated: y
send_notification: n
ftp_server_name: 10.51.8.22
ftp_server_port: 21
ftp_user_type: Simple
ftp_transfer_direction: DOWNLOAD
ftp_transfer_type: A
ftp_local_user: testuser
ftp_local_name: /home/testuser/
ftp_remote_name: 202204*_file.txt

Environment

Release : 12.0

Component :

Resolution

https://techdocs.broadcom.com/us/en/ca-enterprise-software/intelligent-automation/autosys-workload-automation/12-0-01/reference/ae-job-information-language/jil-job-definitions/ftp-remote-name-attribute-specify-remote-filename-within-an-ftp-job.html

If a wildcard is used for the remote file name, the corresponding local file name (the target) must refer to a directory. In this example, the directory is WC.
 
insert_job: FTP_WILDCARD  job_type: FTP
machine: ftpagent
ftp_server_name: ftpserver-hostname
ftp_server_port: 5222
ftp_transfer_direction: DOWNLOAD
ftp_transfer_type: A
ftp_remote_name: /u1/files/scripts/r*
ftp_local_name: /export/home/ftpfiles/ftpdata/WC
owner: test@ftpserver-hostname

Note: In customer's case, the path for the ftp_remote_name was missing.

Changing "ftp_remote_name: 202204*_file.txt" to "ftp_remote_name: 202204*_file.txt" resolves the issue.

Additional Information

removed sensitive info