Skip to content
Snippets Groups Projects
Commit ade31c05 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch 'version-2' into 'master'

skip file backup if config is missing

See merge request !6
parents 88075b57 0e05aaf6
No related branches found
No related tags found
1 merge request!6skip file backup if config is missing
......@@ -2,6 +2,7 @@
# ignored configs
# ----------------------------------------------------------------------
jobs/*.job
keys/*
logs/auto-*
logs/full-*
logs/inc-*
......
......@@ -53,30 +53,23 @@ function j_init(){
j_banner
if [ ! -d ${DIR_LOGS} ]; then
mkdir -p ${DIR_LOGS} && echo "INFO: dir created ${DIR_LOGS}"
fi
if [ ! -d ${DIR_JOBS} ]; then
# mkdir -p ${DIR_JOBS} && echo "INFO: dir created ${DIR_JOBS}"
echo "ERROR: missing jobs directory. Aborting."
exit 1
fi
# if transfer.sh exists, then a transfer.job must exist too
if [ -x "${DIR_SELF}/transfer.sh" ]; then
ls ${STORAGEFILE} >/dev/null
if [ $? -ne 0 ]; then
echo "ERROR: missing a config file in ${DIR_JOBS}"
exit 1
for myfile in ${JOBFILE} ${DIRFILE} ${STORAGEFILE}
do
if [ ! -f "${myfile}" ]; then
echo "WARNING: missing a config file: $myfile"
# exit 1
fi
fi
if [ ! -d ${DIR_LOGS} ]; then
mkdir -p ${DIR_LOGS} && echo "INFO: dir created ${DIR_LOGS}"
fi
ls ${JOBFILE} ${DIRFILE} >/dev/null
if [ $? -ne 0 ]; then
echo "ERROR: missing a config file in ${DIR_JOBS}"
exit 1
fi
done
# for date definitions like weekdays
JOBDEF_LANG=`_j_getvar ${JOBFILE} "lang"`
......
......@@ -38,7 +38,10 @@
. `dirname $0`/jobhelper.sh
. `dirname $0`/inc_bash.sh
typeset -i rc=0
typeset -i rc=0
if [ ! -r "${DIRFILE}" -o ! -r "${STORAGEFILE}" ]; then
echo "SKIP backup of local files - one of the files is not readable (no error): ${DIRFILE} | ${STORAGEFILE}"
fi
STORAGE_BIN=`_j_getvar ${STORAGEFILE} "bin"`
STORAGE_BASEDIR=`_j_getvar ${STORAGEFILE} "storage"`
......@@ -266,7 +269,7 @@
# --- backup
h3 "`date` Backup ${mydir}"
sCmd="$( t_backupDirGetCmdBackup)"
sCmd="$( t_backupDirGetCmdBackup )"
echo "what: ${mydir}"
echo "target: ${sTarget}"
echo "command: $sCmd"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment