diff --git a/.gitignore b/.gitignore index 6b5ad9a8324e1e4af5a99f9bd19f532a957bf0f8..5596aec29cb5619fd094878a3c60f79e3b6815ab 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ # ignored configs # ---------------------------------------------------------------------- jobs/*.job +keys/* logs/auto-* logs/full-* logs/inc-* diff --git a/jobhelper.sh b/jobhelper.sh index 9c13a065920531baa26a13540938d7c0340c064a..08700356d81c8b80af59770dfff7cba28aa71517 100755 --- a/jobhelper.sh +++ b/jobhelper.sh @@ -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"` diff --git a/transfer.sh b/transfer.sh index 7ea65e0a30d7a4ed8a91a404d11a00bd5d30570d..e76de8de75ead6bea5f066f25768acc40592c0e2 100755 --- a/transfer.sh +++ b/transfer.sh @@ -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"