Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #14 from petiepooo/patch-2
Browse files Browse the repository at this point in the history
stderr redirects when listing logfiles
  • Loading branch information
dougburks authored Jun 22, 2017
2 parents 18813ec + 4330a53 commit 652c2b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions usr/lib/nsmnow/lib-nsm-common-utils
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ process_restart()

# Rotate the log file and keep a maximum of 10
[ -f "$LOG_FILE" ] && mv "$LOG_FILE" "$LOG_FILE".`date +%Y%m%d%H%M%S`
[ `ls "$LOG_FILE".* |wc -l` -gt 10 ] && ls "$LOG_FILE".* |head -1 |xargs rm -f
[ `ls "$LOG_FILE".* 2>/dev/null|wc -l` -gt 10 ] && ls "$LOG_FILE".* |head -1 |xargs rm -f

# Start the process
if [ "$#" -eq "6" ]; then
Expand Down Expand Up @@ -1154,7 +1154,7 @@ process_restart_if_stale()
process_stop "$APP" "$PID_FILE" "$APP_DESC"
# Rotate the log file and keep a maximum of 10
[ -f "$LOG_FILE" ] && mv "$LOG_FILE" "$LOG_FILE".`date +%Y%m%d%H%M%S`
[ `ls "$LOG_FILE".* |wc -l` -gt 10 ] && ls "$LOG_FILE".* |head -1 |xargs rm -f
[ `ls "$LOG_FILE".* 2>/dev/null|wc -l` -gt 10 ] && ls "$LOG_FILE".* |head -1 |xargs rm -f
if [ "$#" -eq "6" ]; then
process_start "$APP" "$APP_OPTIONS" "$PID_FILE" "$LOG_FILE" "$APP_DESC" "$USER"
else
Expand Down Expand Up @@ -1213,7 +1213,7 @@ process_restart_with_overlap()
else
# Rotate the log file and keep a maximum of 10
[ -f "$LOG_FILE" ] && mv "$LOG_FILE" "$LOG_FILE".`date +%Y%m%d%H%M%S`
[ `ls "$LOG_FILE".* |wc -l` -gt 10 ] && ls "$LOG_FILE".* |head -1 |xargs rm -f
[ `ls "$LOG_FILE".* 2>/dev/null|wc -l` -gt 10 ] && ls "$LOG_FILE".* |head -1 |xargs rm -f

rm -f $PID_FILE
process_start "$APP" "$APP_OPTIONS" "$PID_FILE" "$LOG_FILE" "$APP_DESC"
Expand Down

0 comments on commit 652c2b9

Please sign in to comment.