Cronjob and mysql connection

i’ve a cronjob that check db and send email to an user if credit value is less than 10:
inside: webmin -> Scheduled Cron Jobs:

  1. Execute cron job as: what user have i to select to run cronjbo? root or the user that connect to db and own the domain?

  2. COMMAND: this url is correct to generate e report in a file?
    php -q /home/domain/public_html/includes/cronjob/check_credit.php >> /home/domain/public_html/sys/sent_email_log.txt

for now i’ve used root as user and that command, but nothing happens. inside the php script there is an “echo” that print something, but i’ve a sent_emai_log.txt empty.



You may want to take a peek at whichever log in /var/log that keeps track of cron jobs (it differs depending on your distro) – it’s possible an error is being logged into there.