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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
iml-backup
Commits
0e05aaf6
Commit
0e05aaf6
authored
4 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
skip file backup if config is missing
parent
c174b9ee
No related branches found
No related tags found
1 merge request
!6
skip file backup if config is missing
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
jobhelper.sh
+10
-17
10 additions, 17 deletions
jobhelper.sh
transfer.sh
+5
-2
5 additions, 2 deletions
transfer.sh
with
16 additions
and
19 deletions
.gitignore
+
1
−
0
View file @
0e05aaf6
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
# ignored configs
# ignored configs
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
jobs/*.job
jobs/*.job
keys/*
logs/auto-*
logs/auto-*
logs/full-*
logs/full-*
logs/inc-*
logs/inc-*
...
...
This diff is collapsed.
Click to expand it.
jobhelper.sh
+
10
−
17
View file @
0e05aaf6
...
@@ -53,30 +53,23 @@ function j_init(){
...
@@ -53,30 +53,23 @@ function j_init(){
j_banner
j_banner
if
[
!
-d
${
DIR_LOGS
}
]
;
then
mkdir
-p
${
DIR_LOGS
}
&&
echo
"INFO: dir created
${
DIR_LOGS
}
"
fi
if
[
!
-d
${
DIR_JOBS
}
]
;
then
if
[
!
-d
${
DIR_JOBS
}
]
;
then
# mkdir -p ${DIR_JOBS} && echo "INFO: dir created ${DIR_JOBS}"
# mkdir -p ${DIR_JOBS} && echo "INFO: dir created ${DIR_JOBS}"
echo
"ERROR: missing jobs directory. Aborting."
echo
"ERROR: missing jobs directory. Aborting."
exit
1
exit
1
fi
fi
# if transfer.sh exists, then a transfer.job must exist too
for
myfile
in
${
JOBFILE
}
${
DIRFILE
}
${
STORAGEFILE
}
if
[
-x
"
${
DIR_SELF
}
/transfer.sh"
]
;
then
do
ls
${
STORAGEFILE
}
>
/dev/null
if
[
!
-f
"
${
myfile
}
"
]
;
then
if
[
$?
-ne
0
]
;
then
echo
"WARNING: missing a config file:
$myfile
"
echo
"ERROR: missing a config file in
${
DIR_JOBS
}
"
# exit 1
exit
1
fi
fi
fi
done
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
# for date definitions like weekdays
# for date definitions like weekdays
JOBDEF_LANG
=
`
_j_getvar
${
JOBFILE
}
"lang"
`
JOBDEF_LANG
=
`
_j_getvar
${
JOBFILE
}
"lang"
`
...
...
This diff is collapsed.
Click to expand it.
transfer.sh
+
5
−
2
View file @
0e05aaf6
...
@@ -38,7 +38,10 @@
...
@@ -38,7 +38,10 @@
.
`
dirname
$0
`
/jobhelper.sh
.
`
dirname
$0
`
/jobhelper.sh
.
`
dirname
$0
`
/inc_bash.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_BIN
=
`
_j_getvar
${
STORAGEFILE
}
"bin"
`
STORAGE_BASEDIR
=
`
_j_getvar
${
STORAGEFILE
}
"storage"
`
STORAGE_BASEDIR
=
`
_j_getvar
${
STORAGEFILE
}
"storage"
`
...
@@ -266,7 +269,7 @@
...
@@ -266,7 +269,7 @@
# --- backup
# --- backup
h3
"
`
date
`
Backup
${
mydir
}
"
h3
"
`
date
`
Backup
${
mydir
}
"
sCmd
=
"
$(
t_backupDirGetCmdBackup
)
"
sCmd
=
"
$(
t_backupDirGetCmdBackup
)
"
echo
"what:
${
mydir
}
"
echo
"what:
${
mydir
}
"
echo
"target:
${
sTarget
}
"
echo
"target:
${
sTarget
}
"
echo
"command:
$sCmd
"
echo
"command:
$sCmd
"
...
...
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