I’m using wget to download new files from a FTP server. The new files that have been downloaded need to be processed by another script.
wget -N -r ftp://server/folder
So my question is: How do i get a list of all files that wget has been downloaded?
Thanks in advance!
You can use wget’s
-oflag to pipe the standard output to a logfile. The logfile will have the same format as the regular output to a terminal, for example:If you pipe this file through egrep as
egrep -e "--" logfile.txtyou will get only the lines specifying which files were downloaded, with timestamps.If you wish, you can then pipe it to cut
egrep -e "--" logfile.txt|cut -d ' ' -f 4to get only to downloaded files.You should add error-checks in here as well, but this is the basic outline.