Last active
November 4, 2023 06:40
-
-
Save fire1ce/068cbf0802955fb2422fb7a64772b11a to your computer and use it in GitHub Desktop.
Revisions
-
Stas Kosatuhin revised this gist
Apr 8, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,7 @@ Add the code below to .sh file. # exec 2<&- # Close STDERR FD parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) LOG_FILE=$parent_path'/error.log' #log file name exec 1>> $LOG_FILE # Open STDOUT as $LOG_FILE file for read and write. exec 2>&1 # Redirect STDERR to STDOUT echo | date "+%Y-%m-%d %H:%M:%S" -
Stas Kosatuhin revised this gist
Apr 8, 2018 . 1 changed file with 1 addition and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,6 @@ Add the code below to .sh file. ```bash # Optional: # exec 1<&- # Close STDOUT file descriptor @@ -15,7 +10,7 @@ parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) LOG_FILE=$parent_path'/err.log' #log file name exec 1>> $LOG_FILE # Open STDOUT as $LOG_FILE file for read and write. exec 2>&1 # Redirect STDERR to STDOUT echo | date "+%Y-%m-%d %H:%M:%S" # example: echo "Time Stamp should be above this line" -
Stas Kosatuhin revised this gist
Apr 8, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ Dependencies: "moreutils" should be installed on the os use brew/apt-get/wget/yum install moreutils depends on you os. Add the code below to .sh file. -
Stas Kosatuhin revised this gist
Apr 8, 2018 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,10 @@ Dependencies: "moreutils" should be installed on the os; use brew/apt-get/wget/yum install moreutils depends on you os. Add the code below to .sh file. ```bash # Optional: # exec 1<&- # Close STDOUT file descriptor -
Stas Kosatuhin revised this gist
Apr 8, 2018 . 1 changed file with 3 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,6 @@ Dependencies: "moreutils" should be installed on the os. use brew/apt-get/wget/yum install moreutils depends on you os. Add the code below to .sh file. ```bash -
Stas Kosatuhin revised this gist
Apr 8, 2018 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ Dependencies: "moreutils" should be installed on the os use brew/apt-get/wget/yum install moreutils depends on you os Add the code below to .sh file -
Stas Kosatuhin revised this gist
Apr 8, 2018 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,4 @@ Dependencies: "moreutils" should be installed on the os use brew/apt-get/wget/yum install moreutils depends on you os Add the code below to .sh file -
Stas Kosatuhin revised this gist
Apr 8, 2018 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,7 @@ Dependencies: "moreutils" should be installed on the os use brew/apt-get/wget/yum install moreutils depends on you os Add the code below to .sh file -
Stas Kosatuhin revised this gist
Apr 8, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,8 @@ Dependencies: "moreutils" should be installed on the os use brew/apt-get/wget/yum install moreutils depends on you os Add the code below to .sh file ```bash # Optional: # exec 1<&- # Close STDOUT file descriptor -
Stas Kosatuhin revised this gist
Apr 8, 2018 . No changes.There are no files selected for viewing
-
Stas Kosatuhin revised this gist
Apr 8, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Add the code below to .sh file # exec 2<&- # Close STDERR FD parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) LOG_FILE=$parent_path'/err.log' #log file name exec 1>> $LOG_FILE # Open STDOUT as $LOG_FILE file for read and write. exec 2>&1 # Redirect STDERR to STDOUT echo | ts '[%Y-%m-%d %H:%M:%S]' -
Stas Kosatuhin revised this gist
Apr 8, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,8 +11,9 @@ exec 1>> $LOG_FILE # Open STDOUT as $LOG_FILE file for read and write. exec 2>&1 # Redirect STDERR to STDOUT echo | ts '[%Y-%m-%d %H:%M:%S]' # example: echo "Time Stamp should be above this line" cat nofile.example ``` -
Stas Kosatuhin revised this gist
Apr 8, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,8 @@ exec 1>> $LOG_FILE # Open STDOUT as $LOG_FILE file for read and write. exec 2>&1 # Redirect STDERR to STDOUT echo | ts '[%Y-%m-%d %H:%M:%S]' echo "Time Stamp should be above this line" echo nofile.example ``` -
Stas Kosatuhin revised this gist
Apr 8, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ Add the code below to .sh file ```bash # Optional: # exec 1<&- # Close STDOUT file descriptor -
Stas Kosatuhin renamed this gist
Apr 8, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Stas Kosatuhin revised this gist
Apr 8, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ add This to Bash code to ceate error log with time stemp ```bash # Optional: # exec 1<&- # Close STDOUT file descriptor # exec 2<&- # Close STDERR FD -
Stas Kosatuhin renamed this gist
Apr 8, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ add This to Bash code to ceate error log with time stemp ```bash # Options: # exec 1<&- # Close STDOUT file descriptor -
Stas Kosatuhin renamed this gist
Apr 8, 2018 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
Stas Kosatuhin created this gist
Apr 8, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ Ddd This to Bash code to ceate error log with time stemp ```bash # Options: # exec 1<&- # Close STDOUT file descriptor # exec 2<&- # Close STDERR FD parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) LOG_FILE=$parent_path'/err.log' #Config file name to save exec 1>> $LOG_FILE # Open STDOUT as $LOG_FILE file for read and write. exec 2>&1 # Redirect STDERR to STDOUT echo | ts '[%Y-%m-%d %H:%M:%S]' echo "this sould be show in the err.log file" ```