PHP 项目---LINUX 配置自动脚本

composer.json集成包:
{
"authors": [
{
"name": "erp",
"email": "tech_erp@i9i8.com"
}
],
"require": {
"lavary/crunz": "1.4.8"
}
}

实现demo.php:
use Crunz\Schedule;
$schedule = new Schedule();

调用格式:
//获取销售订单付款时在平台上的交易单号
$schedule->run('flock -nx /tmp/AutoGetTransactionId.lock -c "php /var/www/http/erp/protected/yiic AutoGetTransactionId >> /var/log/update_ecshop/AutoGetTransactionId.$(date +\%Y\%m\%d) 2>&1"')
->everyTenMinutes()
->description('yiic AutoGetTransactionId');
posted @ 2018-09-27 10:59  geek0202  阅读(322)  评论(0)    收藏  举报