Php background service to prevent cross-execution-php Tutorial

Source: Internet
Author: User
Php background service prevents cross-execution of sudo mkdir/alidata/www/office/orderlog/
Sudo chown www: www/alidata/www/office/orderlog/-R
Sudo chmod 777/alidata/www/office/orderlog/-R
Sudo vim/alidata/www/office/allocate_order.sh

#! /Bin/bashcount = 'PS aux | grep 'hh/auto-process-order' | grep-v 'grep' | wc-L' if [0 ==$ {count} ]; then orderlog_dir =/alidata/www/office/orderlog/'date + % y % m % d'/orderlog_file =$ {orderlog_dir} 'date + % H' if [! -D $ {orderlog_dir}]; then mkdir-p $ {orderlog_dir} fi if [! -F $ {orderlog_file}]; then touch $ {orderlog_file} fi/alidata/server/php/bin/php/alidata/www/office/yii hh/auto-process-order >$ {orderlog_file} fi

Sudo chown www: www/alidata/www/office/allocate_order.sh


Crontab-e
*/1 *****/alidata/www/office/allocate_order.sh

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.