Thanks in advance for any help!
I have a php script that I have put in a cronjob.
However, all the data is lumped into a log file. I’d like to have it entered with date-time on each line.
The cronjob is:
# Section for Appointment calendar
# run sms reminders hourly
0 8-17 * * * /usr/bin/php /var/www/html/modules/mod_sv_reminders_sms/reminders_cron_sms.php >> /var/log/apptbooking.log 2>&1
It works well, but really unreadable as all data in log file is tossed in.
It is a php script that searches a database for all appointments and sends a text message reminder. I added sending to log file so I can monitor any errors.
I tried amending two ways, neither work:
/usr/bin/php date +%d-%m-%y/%H:%M:%S /var/www/html/modules/mod_sv_reminders_sms/reminders_cron_sms.php >> /var/log/apptbooking.log 2>&1
/usr/bin/php /var/www/html/modules/mod_sv_reminders_sms/reminders_cron_sms.php |ts ‘[%Y-%m-%d %H:%M]’ >> /var/log/apptbooking.log 2>&1
If someone can point me to a solution, or share how to fix, I’d really appreciate it