Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Append new lines to cronjob's output log

Tags:

cron

cpanel

Right now I append my php script's output to a logfile. Unfortunately it writes everything in one line. How do I need to change my cron command to append every execution log in a new line?

My current cronjob looks like this:

/usr/local/bin/php -q /home/username/public_html/forum/cron.php >> /home/username/cron.log 2>&1
like image 407
kentor Avatar asked Dec 14 '22 05:12

kentor


1 Answers

Solved by adding echo "" as below:

/usr/local/bin/php -q /home/username/public_html/forum/cron.php >> /home/username/cron.log 2>&1; echo "" >> /home/username/cron.log
like image 167
kentor Avatar answered Jan 13 '23 11:01

kentor