Common shell script running Log Module

Source: Internet
Author: User
The target implementation record the SHELL execution start time, end time, running status, error information, and so on. The script encapsulates the log record by using the function, and calls the function source code universal function script program_log_new.shfunctioninit_log () {sqlplus-Stestpassw0rd @ orclEOFinsertintoprogram_logvalues ($ id, $ day, $1, s

The target implementation records the SHELL execution start time, end time, running status, error information, and so on. The script encapsulates the log record by using the function, and calls the function source code universal function script program_log_new.sh function init_log () {sqlplus-S test/passw0rd @ orcl EOFinsert into program_log values ($ id, $ day, $1, s

Target

Implement recording of SHELL execution start time, end time, running status, error information, etc. Use the function to encapsulate log records and use scripts to call functions.

Source code universal function script program_log_new.sh
Function init_log () {sqlplus-S test/passw0rd @ orcl <
 
  
#! /Bin/sh .~ /. Bash_profilesource program_log_new.sh // public script init_log sh_xx // initialize the log function call and input the program name shell command xxx 2 >$ {logdir}/xx _ $ time. log exception_write // exception occurred. The call is abnormal. The program exits the shell command xxx 2 >$ {logdir}/xx _ $ time. log exception_write // exception occurred. The call is abnormal and the program exits .... shell Command xxx 2 >$ {logdir}/xx _ $ time. log finish_write // exception occurred. The call is abnormal and the program exits.

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.