我想在圣诞节运行一个php脚本,当我出城时,我会给家人和朋友发送圣诞快乐 并且无法联系他们。 p>
我设置它的方式是我每天都有一个cron运行脚本,然后脚本检查日期是否为12月25日。 如果是,那么脚本会发送电子邮件。 p>
有没有更优雅的方法来做到这一点。 或者让Linux只发送25日运行脚本而不是每天检查的方法。 我知道这不是什么大不了的事,但仍然只是为了了解。 p> div>
I want to run a php script on christmas that will email my family and friends merry christmas while I am out of town and un-able to contact them.
The way I just set it up was I have a cron run the script every day, and then the script checks to see if the date is Dec 25th. If it is then the script sends the emails out.
Is there a more elegant way to do this. Or a way to have linux just send run the script on the 25th rather than checking everyday. I know it's not that big of a deal, but still just for the sake of knowing.
我想在圣诞节运行一个php脚本,当我出城时,我会给家人和朋友发送圣诞快乐 并且无法联系他们。 p>
我设置它的方式是我每天都有一个cron运行脚本,然后脚本检查日期是否为12月25日。 如果是,那么脚本会发送电子邮件。 p>
有没有更优雅的方法来做到这一点。 或者让Linux只发送25日运行脚本而不是每天检查的方法。 我知道这不是什么大不了的事,但仍然只是为了了解。 p> div>