Run shell scripts every 30 seconds

Source: Internet
Author: User

cd/usr/local/sbin///Store shell script directory.

Vim guoguosql.sh//Run a PHP file every 30 seconds. File path is vim/home/wwwroot/www/domain/huitiao/web/sql.php

#! /bin/bashand do        Curl http://127.0.0.1:82/sql.php        sleep -Done

Sh/usr/local/sbin/guoguosql.sh &//run into background run

Vim/etc/rc.d/rc.local//Join boot start at last add:

Sh/usr/local/sbin/guoguosql.sh &

Stop Shell

[Email protected] sbin]# PS aux|grep guoguosql
Root 22899 0.0 0.0 106072 1316 pts/0 S 17:36 0:00 sh/usr/local/sbin/guoguosql.sh
Root 33419 0.0 0.0 103316 908 pts/0 s+ 17:49 0:00 grep guoguosql

Kill 22899

Run shell scripts every 30 seconds

Related Article

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.