Mercurial > hg > plml
annotate cpp/logio @ 37:89688ebc447f tip
Deprecating this repository.
author | samer |
---|---|
date | Mon, 05 Jan 2015 17:42:03 +0000 |
parents | d892e2012f79 |
children |
rev | line source |
---|---|
samer@21 | 1 #!/bin/sh |
samer@21 | 2 |
samer@21 | 3 function handle_term { |
samer@21 | 4 echo "### $(date): received SIGTERM" >> "$outputlog" |
samer@21 | 5 exit |
samer@21 | 6 } |
samer@21 | 7 |
samer@21 | 8 function handle_int { |
samer@21 | 9 echo "### $(date): received SIGINT" >> "$outputlog" |
samer@21 | 10 } |
samer@21 | 11 |
samer@21 | 12 function handle_hup { |
samer@21 | 13 echo "### $(date): received SIGHUP" >> "$outputlog" |
samer@21 | 14 exit |
samer@21 | 15 } |
samer@21 | 16 |
samer@21 | 17 trap handle_int 2 |
samer@21 | 18 trap handle_term 15 |
samer@21 | 19 trap handle_hup 1 |
samer@21 | 20 |
samer@21 | 21 inputlog="$1" |
samer@21 | 22 outputlog="$2" |
samer@21 | 23 shift 2 |
samer@21 | 24 |
samer@21 | 25 echo "### $(date): INPUT - $@" >> "$inputlog" |
samer@21 | 26 echo "### $(date): OUTPUT - $@" >> "$outputlog" |
samer@21 | 27 nohup tee -a "$inputlog" | "$@" | nohup tee -a "$outputlog" |