I was wondering the best way about finding files that were created today and copy them to a directory (grep ?). There can be multiple files for todays date or none. I am looking to copy all of the .lis files for todays date. I may need to modify the filename to include todays date but for the time being I just want to find the files that were created today and copy them to a directory.
Data:
-rw-rw-rw- 1 user user 1697 Nov 24 09:57 file_8885724.lis
-rw-rw-rw- 1 user user 103 Nov 24 09:57 file_8885724.log
-rw-rw-rw- 1 user user 1696 Nov 25 09:58 file_8885728.lis
-rw-rw-rw- 1 user user 537 Nov 25 09:58 file_8885728.log
-rw-rw-rw- 1 user user 1700 Nov 25 09:58 file_8885730.lis
-rw-rw-rw- 1 user user 2663 Nov 25 09:58 file_8885730.log
-rw-rw-rw- 1 user user 1700 Nov 25 09:59 file_8885731.lis
-rw-rw-rw- 1 user user 967 Nov 25 09:59 file_8885731.log
-rw-rw-rw- 1 user user 1700 Nov 25 09:59 file_8885732.lis
-rw-rw-rw- 1 user user 1817 Nov 25 10:00 file_8885732.log
-rw-rw-rw- 1 user user 1700 Nov 26 10:00 file_8885739.lis
-rw-rw-rw- 1 user user 529 Nov 26 10:00 file_8885739.log
-rw-rw-rw- 1 user user 1693 Nov 26 10:00 file_8885743.lis
-rw-rw-rw- 1 user user 103 Nov 26 10:00 file_8885743.log
-rw-rw-rw- 1 user user 1697 Nov 26 10:01 file_8885744.lis
-rw-rw-rw- 1 user user 103 Nov 26 10:01 file_8885744.log
-rw-rw-rw- 1 user user 1697 Nov 26 10:01 file_8885751.lis
-rw-rw-rw- 1 user user 103 Nov 26 10:01 file_8885751.log
Script:
#!/bin/bash
#copy files
cd $1
#I need a loop that will copy the files with todays date
scp $2 $3
#end of loop
Any help would be appreciated. Also, if you provide working code then that would be even better.