0

I have a cronjob setup and running, but the logfile keeps getting overwritten every time it runs. I would like for the wget output to be appended each time the cron runs.

Why is this and how do I fix it?

0 0 * * * wget url/script.php -O - >> /home/user/app/logs/logfile
doremi
  • 231
  • 3
  • 11

1 Answers1

1
man wget
-a logfile
       --append-output=logfile
           Append to logfile.  This is the same as -o, only it appends to
           logfile instead of overwriting the old log file.  If logfile does
           not exist, a new file is created.

Try with this one scheme.

MealstroM
  • 1,517
  • 1
  • 17
  • 32
  • `-o` != `-O`. One is appending the log data, and the other is appending the payload. – Zoredache Oct 15 '13 at 19:39
  • -O - should be outputting the wget response to stdout. From there, I would think >> should be responsible for actually appending data. I shouldn't need to care if wget output is appending or not if >> is supposed to be append whatever output it sent to it, right? – doremi Oct 17 '13 at 00:41