I have a Python script that executes wget
to download files. Cron is in charge of executing the script periodically and I redirect the output to a file so that I can see the log whenever I want:
* * * * * /mnt/scripts/cronjobs/downloader.sh >> /home/user/downloader.log 2>&1
If I manually execute the script I can see the progress of the wget
in a nice not overflowing way. Something like this:
filename.extension ===========================================================> 45MB/s 34s
And it gets updated single line, without creating thousands of lines, which is really nice.
But when I tail -f
the output of the cron, I see something like this:
113650K .......... .......... .......... .......... .......... 3% 48.7M 96s
113700K .......... .......... .......... .......... .......... 3% 58.9M 96s
113750K .......... .......... .......... .......... .......... 3% 46.1M 96s
113800K .......... .......... .......... .......... .......... 3% 61.4M 96s
113850K .......... .......... .......... .......... .......... 3% 84.9M 96s
113900K .......... .......... .......... .......... .......... 3% 54.9M 96s
113950K .......... .......... .......... .......... .......... 3% 47.4M 96s
114000K .......... .......... .......... .......... .......... 3% 59.5M 96s
114050K .......... .......... .......... .......... .......... 3% 73.2M 96s
114100K .......... .......... .......... .......... .......... 3% 55.5M 96s
114150K .......... .......... .......... .......... .......... 3% 70.0M 96s
114200K .......... .......... .......... .......... .......... 3% 56.9M 96s
114250K .......... .......... .......... .......... .......... 3% 74.0M 96s
114300K .......... .......... .......... .......... .......... 3% 65.9M 96s
114350K .......... .......... .......... .......... .......... 3% 70.7M 96s
114400K .......... .......... .......... .......... .......... 3% 45.5M 96s
114450K .......... .......... .......... .......... .......... 3% 78.0M 96s
And it keeps creating thousands of lines, so it's really difficult to keep track of the progress and the file keeps growing huge.
Is there any way to avoid stacking up thousands of lines of this output? If so, how?
Thanks in advance!