我有一个包含此
的cron file
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
MAILTO="myemail@gmail.com"
* * * * * php /home/forge/biossantibodies/artisan products:exportdiff --env=development
* * * * * php /home/forge/biossantibodies/artisan images:exportdiff --env=development
* * * * * php /home/forge/biossantibodies/artisan publications:exportdiff --env=development
* * * * * mailx -s "CronJob is run successfully" ben@gmail.com
我希望它在cron作业成功运行后向我发送电子邮件。
我已经尝试了
MAILTO="myemail@gmail.com"
和
* * * * * mailx -s "CronJob is run successfully" myemail@gmail.com
我从未收到任何电子邮件,我也查看了垃圾邮件文件夹,但我注意到他们之间的任务有效。
如何进行配置?
我现在正在接受任何建议。
任何提示/建议/帮助都将非常感谢!