Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"
  4.  
  5. run="$2 $*"
  6. dir="$4/$6"
  7.  
  8. start()
  9. {
  10.  
  11. while true
  12. do
  13.  
  14. $run
  15.  
  16. echo "`date` : Restart in 10 seconds"
  17.  
  18. log
  19.  
  20. sleep 10
  21.  
  22. done
  23.  
  24. }
  25.  
  26. log()
  27. {
  28.  
  29.  
  30. if [ -e $dir/qconsole.log ]
  31. then
  32.  
  33. if [ ! -e $dir/console ]
  34. then
  35.  
  36. mkdir $dir/console > /dev/null
  37.  
  38. fi
  39.  
  40. mv $dir/qconsole.log $dir/console/L`date +%Y%m%d%H%M%S`.log > /dev/null
  41.  
  42. fi
  43.  
  44. }
  45.  
  46. log
  47. start
  48. quit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement