I have to download, with a scheduled script, the latest file from an FTP server.
In the remote DIR, named .../TEKNONET/60468/, every night a CDR file like this gets uploaded into it: 000006046820151122N001.CDR, so my script will have to download every day the previous day file.
Could you please help me to build this script?
Thanks
I have to login in this remote FTP. I suppose that it is interactive as I can do ls and other commands.
Could you please post a bash to login ftp, cd to remote directory /TEKNONET/60468/ and then get the latest file in this format: 0000060468yyyymmddN00. Zip?
I stress the fact that this "automate script" must download every day the regarding zip file.
Ex. Today's zip file belongs to yesterday, yesterday's file belonged to the day before yesterday, ecc...
Inside remote dir... /TEKNONET/60468/ there are all .Zip files containing a CDR file. These zip files have the timestamp on them in the format 0000060468yyyymmddN001.Zip
Are both machines in the same time zone.
Will there be a file on weekends and statutory holidays.
How much time is there between the time the file is available and the attempt to retrieve it.
Will a checksum be available.
The time zone is the same.
The only thing is that in the remote dir the Zip file regarding every monday is not given, so whatever script you are going to write, it must have an option which tells that Monday's files must not be downloaded as they dont exists.
The scheduling of this script must be at least from 04.50 am to 08.30am you choose.