Executing shell scripts in the background

Source: Internet
Author: User
Tags log log


Execution mode:

Nohup sh export_data.sh 20150102 >20150102.log 2>&1 &[1] 29531

0, 1 and 2 respectively represent the following meanings:
0–stdin (Standard input)
1–stdout (Standard output)
2–stderr (standard error)


Nohup+ 's back & is to have the command execute in the background

>out.log is the output of information to the Out.log log

2>&1 is to convert standard error messages into standard output so that error messages can be exported to the Out.log log.


To see if this process is running in the background:

Ps-ef | grep 29531mobile   29531  6103  0 19:59 pts/16   00:00:00 sh export_data.sh 20150102


Benefits:

Use a VPN at home to remotely log in to your company cluster without worrying about outages due to bad network.


Executing shell scripts in the background

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.