I'm new in shell coding and hopefully I'm in the right place to ask this question. I'm working with a shell script which collect daily file and send them via ftp. In the filename there are both date and time and type of files is text
(.txt). Files are in a directory in which there are many other files that are created daily at different time. Those files that I'm trying to send are created at 08 am but with different minute and seconds. for example:
Time is different in the filename but all of them have 08 for hour and I want to send all files that has for example today date and 08 as hour with whatever minute and seconds(it doesn't matter which minute and second). Here is my code:
#!/bin/ksh # # DATE=`date "+%Y-%m-%d"` HOST='abcd.dmn.com' USER='*****' PASSWD='******' LOCALPATH='/opt/abc/Output' LOGPATH='/opt/abc/logs' ftp -n -v $HOST <<END_SCRIPT>>$LOGPATH/ftp_abc_$DATE_log.txt quote USER $USER quote PASS $PASSWD lcd $LOCALPATH put team1_abc_part_$DATE_(I do not know what should I write here).txt put team1_mnpg_ef_part_$DATE_.txt put team1_fdop_part_$DATE_.txt quit END_SCRIPT exit 0
Files are in the directory and when I write the timestamp,for example
put team1_abc_part_$DATE_080031.txt in the above script, it works fine and I can see the sent file on destination server.
What should I write for time part in the filename so that script sends the files that has been created at 08 with whatever minute and second?