Saturday, June 22, 2019

logging - Wget write log to file and verbose


I am writing a script that will download Wikipedia dumps. I want wget to write all message to a log file but I also want it to write all message to the screen. Any answer? I use this script and it only write infomation to the log file.


wget -r -np -nH -R index.html -a ./$logn-viwikibooks.txt http://dumps.wikimedia.org/viwikibooks/latest/

Which


logn=`date +%d-%m-%Y'

Even if I add '-v' option, there is nothing on the screen


Answer



Use tee:


wget -o /dev/stdout -r -np -nH -R index.html http://dumps.wikimedia.org/viwikibooks/latest/ | tee -a ./$logn-viwikibooks.txt

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...