Linux uses shell scripts for the key Nohup and shellnohup tasks

Source: Internet
Author: User

Linux uses shell scripts for the key Nohup and shellnohup tasks

There are many articles on the Internet to teach you how to use scheduled tasks, so I will not talk much about other nonsense.


I have SH for timing, but you don't know it. You must use Nohup. Otherwise, the SH task will be automatically terminated after you exit the terminal.


Assume there is a tash. sh. Note the following:


Start: nohup/home/spex/bin_prodDemo/task. sh & make sure the path is complete, absolute address

Exit. Remember to quit !!! Exit the terminal with exit !! Do not exit directly. Otherwise it will still be useless.


Check ps aux | grep task.

You can see that it is running there.


Root 279 0.0 0.0 0 0? S Sep26 0: 00 [khungtaskd]
Spex 11488 0.0 0.0 63868 1096? S/bin/sh/home/spex/bin_prodDemo/task. sh
Spex 11544 0.0 0.0 61208 756 pts/3 S + grep task





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.