diff --git a/backup.sh b/backup.sh index e4bcfabdf07088b08d95c4d46b979e7aa01ab959..86f1ebda632769447c3f1a85c173c06f38381d60 100755 --- a/backup.sh +++ b/backup.sh @@ -91,7 +91,7 @@ do echo "Param: setting to AUTO on duplicity" echo "$2" | grep "^[1-9][0-9]*[a-zA-Z]$" 2>/dev/null if [ $? -ne 0 ]; then - echo "ERROR: the value after $1 must be a number and a letter (for unit); i.e. 1M for 1 month" + >&2 echo "ERROR: the value after $1 must be a number and a letter (for unit); i.e. 1M for 1 month" exit 1 else JOBDEF_TYPE=auto @@ -112,7 +112,7 @@ do bStart=1 ;; *) - echo "ERROR: parameter [$1] is unknown" + >&2 echo "ERROR: parameter [$1] is unknown" showHelp exit 1 esac diff --git a/jobhelper.sh b/jobhelper.sh index 130925715778b5817f529b28ba9c361648546d6f..1158e2c128b78724bb9def2a68a1d34d4db5e203 100755 --- a/jobhelper.sh +++ b/jobhelper.sh @@ -47,7 +47,7 @@ function j_init(){ if [ ! -d "${DIR_JOBS}" ]; then # mkdir -p ${DIR_JOBS} && echo "INFO: dir created ${DIR_JOBS}" - echo "ERROR: missing jobs directory. Aborting." + >&2 echo "ERROR: missing jobs directory. Aborting." exit 1 fi @@ -169,7 +169,7 @@ function j_getSafename(){ # ------------------------------------------------------------ function _j_getvar(){ if [ ! -r "${1}" ]; then - echo "ERROR: cannot read file: ${1}. Abort." + >&2 echo "ERROR: cannot read file: ${1}. Abort." exit 100 fi grep "^${2}\ =\ " < "${1}"| cut -f 3- -d " " @@ -373,7 +373,7 @@ function j_requireProcess(){ function j_requireUser(){ sUser=$(id | cut -f 2 -d "(" | cut -f 1 -d ")") if [[ "$sUser" != "$1" ]]; then - echo "ERROR: user $1 is reqired." + >&2 echo "ERROR: user $1 is reqired." exit 5 fi }