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

jobhelper: move cfg var

parent d90cc1d3
Branches
No related tags found
1 merge request!26Eliminate scheduler
......@@ -151,31 +151,6 @@ function j_getFullTarget(){
echo "${STORAGE_BASEDIR}/${sTmpHostname}/${sTmpSafeName}"
}
# ------------------------------------------------------------
# get minimal Age of last backup that had to run in hours
# it returns a value between 24 and 96
# ------------------------------------------------------------
# function j_getLastBackupAge(){
# typeset -i sCmpDate
# typeset -i iWasInc
# typeset -i iWasFull
# j_read
# JOBDEF_INC=`_j_getvar ${JOBFILE} "inc"`
# JOBDEF_FULL=`_j_getvar ${JOBFILE} "full"`
# for iDeltaH in {24..96}
# do
# sCmpDate=`date +%s`-iDeltaH*60*60
# iWasInc=`_j_runToday @${sCmpDate} $JOBDEF_INC`
# iWasFull=`_j_runToday @${sCmpDate} $JOBDEF_FULL`
# if [ ${iWasInc} -gt 0 -o ${iWasFull} -gt 0 ]; then
# echo $iDeltaH
# exit
# fi
# done
# echo $iDeltaH
# }
# ------------------------------------------------------------
# replace / to _ to get a save filename for a directory to
......@@ -283,44 +258,20 @@ function j_read(){
BACKUP_TARGETDIR=$(_j_getvar "${JOBFILE}" "dir-local-dumps")
export BACKUP_TARGETDIR
JOBDEF_TYPE=$(_j_getvar ${JOBFILE} "type")
JOBDEF_TYPE=$(_j_getvar ${STORAGEFILE} "type")
export JOBDEF_TYPE
# JOBDEF_INC=`_j_getvar ${JOBFILE} "inc"`
# JOBDEF_FULL=`_j_getvar ${JOBFILE} "full"`
# JOBDEF_AUTO=`_j_getvar ${JOBFILE} "auto"`
# if [ "$JOBDEF_TYPE" = "auto" ]; then
# if [ -z "$JOBDEF_AUTO" ]; then
# JOBDEF_AUTO=1W
# fi
# else
# JOBDEF_AUTO=
# fi
# bIsTodayInc=`_j_isToday $JOBDEF_INC`
# bIsTodayFull=`_j_isToday $JOBDEF_FULL`
# JOB_DOTODAY=1
# if [ $bIsTodayFull -eq 0 -a $bIsTodayInc -eq 0 ]; then
# JOB_DOTODAY=0
# fi
# sStartInc=`_j_fetchLatestStarttime "start-time-inc"`
# JOBDEF_STARTTIME=$sStartInc
if [ "$JOBDEF_TYPE" != "auto" ]; then
# ----- detect if current date matches a definition "full = ..."
local cfg_full; cfg_full=$(_j_getvar "${JOBFILE}" "full")
local cfg_full; cfg_full=$(_j_getvar "${STORAGEFILE}" "full")
local bIsTodayFull; bIsTodayFull=$(_j_isToday "$cfg_full")
# ... if "1" ... then verify time with "start-time-full = ...""
if [ $bIsTodayFull -eq 1 ]; then
local sStart
sStart=$(_j_getvar "${JOBFILE}" "start-time-full")
sStart=$(_j_getvar "${STORAGEFILE}" "start-time-full")
test -z "$sStart}" && sStart="."
if date +%H:%M | grep "$sStart" >/dev/null; then
JOBDEF_TYPE=full
......@@ -333,7 +284,7 @@ function j_read(){
JOBDEF_TYPE=auto
fi
test "${JOBDEF_TYPE}" = "auto" && JOBDEF_AUTO=$(_j_getvar ${JOBFILE} "auto")
test "${JOBDEF_TYPE}" = "auto" && JOBDEF_AUTO=$(_j_getvar ${STORAGEFILE} "auto")
export JOBDEF_AUTO
_j_setLogfile
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment