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.