From 2fb2166585aee757fb7a4de9b93d9df0e05e1221 Mon Sep 17 00:00:00 2001 From: ssamson-tis Date: Thu, 9 Jul 2015 10:42:47 +0200 Subject: [PATCH] One log file --- scripts/tisbackup_gui | 9 ++++----- scripts/tisbackup_huey | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/scripts/tisbackup_gui b/scripts/tisbackup_gui index 58367df..40860cc 100755 --- a/scripts/tisbackup_gui +++ b/scripts/tisbackup_gui @@ -15,8 +15,7 @@ user="root" name=`basename $0` pid_file="/var/run/$name.pid" -stdout_log="/var/log/$name.log" -stderr_log="/var/log/$name.err" +logfile="/var/log/$name.log" get_pid() { cat "$pid_file" @@ -34,13 +33,13 @@ case "$1" in echo "Starting $name" cd "$dir" if [ -z "$user" ]; then - sudo $cmd >> "$stdout_log" 2>> "$stderr_log" & + sudo $cmd >> "$logfile" 2>&1 & else - sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" & + sudo -u "$user" $cmd >> "$logfile" 2>&1 & fi echo $! > "$pid_file" if ! is_running; then - echo "Unable to start, see $stdout_log and $stderr_log" + echo "Unable to start, see $logfile" exit 1 fi fi diff --git a/scripts/tisbackup_huey b/scripts/tisbackup_huey index 89421ed..ff152e8 100755 --- a/scripts/tisbackup_huey +++ b/scripts/tisbackup_huey @@ -15,8 +15,7 @@ user="root" name=`basename $0` pid_file="/var/run/$name.pid" -stdout_log="/var/log/$name.log" -stderr_log="/var/log/$name.err" +logfile="/var/log/$name.log" get_pid() { cat "$pid_file" @@ -34,13 +33,13 @@ case "$1" in echo "Starting $name" cd "$dir" if [ -z "$user" ]; then - sudo $cmd >> "$stdout_log" 2>> "$stderr_log" & + sudo $cmd >> "$logfile" 2>&1 & else - sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" & + sudo -u "$user" $cmd >> "$logfile" 2>&1 & fi echo $! > "$pid_file" if ! is_running; then - echo "Unable to start, see $stdout_log and $stderr_log" + echo "Unable to start, see $logfile" exit 1 fi fi