ftp by mask

Good time of day!
There is server from which I need download files. Files have names according to date and time (e.g. 20160320110002.txt, 20160320210218.txt, ...) Every evening I should download files for current date using .netrc. .netrc contains:
Code:
machine хх.ххх.ххх.ххх 
login хххххх 
password хххххх 
macdef init 
lcd local-path 
cd path-to-files 
prompt off 
binary hash 
mget 201* 
exit
I wish that line mget 201* has mask with current date - 20160321* (not 201*), because now I download all files and that is not rationally (too many files). Could somebody suggest , how mask can be used in .netrc.

Thanks in advance
 
You could use the .netrc only for login information and run something like
Code:
#!/bin/sh

ymd=`date +%Y%m%d` && cd local_directory && ftp "remote:/remote_directory/${ymd}*.txt"

Juha
 
Just today I was searching such function and found it with using perl.
But date -v-1d is more suitable for me.
Once more, MANY THANKS, Juha.
 
Back
Top