Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iml-backup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
iml-backup
Commits
00bf94cc
Commit
00bf94cc
authored
3 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
jobhelper: move cfg var
parent
d90cc1d3
Branches
Branches containing commit
No related tags found
1 merge request
!26
Eliminate scheduler
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
jobhelper.sh
+4
-53
4 additions, 53 deletions
jobhelper.sh
with
4 additions
and
53 deletions
jobhelper.sh
+
4
−
53
View file @
00bf94cc
...
...
@@ -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
${
JOB
FILE
}
"type"
)
JOBDEF_TYPE
=
$(
_j_getvar
${
STORAGE
FILE
}
"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
"
${
JOB
FILE
}
"
"full"
)
local
cfg_full
;
cfg_full
=
$(
_j_getvar
"
${
STORAGE
FILE
}
"
"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
"
${
JOB
FILE
}
"
"start-time-full"
)
sStart
=
$(
_j_getvar
"
${
STORAGE
FILE
}
"
"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
${
JOB
FILE
}
"auto"
)
test
"
${
JOBDEF_TYPE
}
"
=
"auto"
&&
JOBDEF_AUTO
=
$(
_j_getvar
${
STORAGE
FILE
}
"auto"
)
export
JOBDEF_AUTO
_j_setLogfile
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment