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
b980df48
Commit
b980df48
authored
2 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Plain Diff
Merge branch 'finetune-output' into 'master'
Finetune output See merge request
!79
parents
50da1e1c
0f0fb415
No related branches found
No related tags found
1 merge request
!79
Finetune output
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
backup.sh
+2
-2
2 additions, 2 deletions
backup.sh
plugins/transfer/restic.sh
+0
-2
0 additions, 2 deletions
plugins/transfer/restic.sh
transfer.sh
+60
-61
60 additions, 61 deletions
transfer.sh
with
62 additions
and
65 deletions
backup.sh
+
2
−
2
View file @
b980df48
...
@@ -158,7 +158,7 @@ EOFhelp
...
@@ -158,7 +158,7 @@ EOFhelp
type :
$JOBDEF_TYPE
$JOBDEF_AUTO
type :
$JOBDEF_TYPE
$JOBDEF_AUTO
log :
$JOB_LOGFILE
log :
$JOB_LOGFILE
target :
${
STORAGE_BASEDIR
}
target :
$(
echo
${
STORAGE_BASEDIR
}
|
sed
's#:[^:]*@#:**********@#'
)
EOFbackupinfo
EOFbackupinfo
test
-z
"
$STORAGE_BASEDIR
"
||
(
test
-z
"
$STORAGE_BASEDIR
"
||
(
...
@@ -201,7 +201,7 @@ EOFbackupinfo
...
@@ -201,7 +201,7 @@ EOFbackupinfo
if
[
-n
"
$STORAGE_BASEDIR
"
]
&&
[
-x
"
${
DIR_SELF
}
/transfer.sh"
]
;
then
if
[
-n
"
$STORAGE_BASEDIR
"
]
&&
[
-x
"
${
DIR_SELF
}
/transfer.sh"
]
;
then
# transfer files
# transfer files
cat
"
$STORAGEFILE
"
>>
"
$JOB_LOGFILE
"
#
cat "$STORAGEFILE" >>"$JOB_LOGFILE"
echo
"INFO:
$(
date
)
- Sending data to storage...
${
DIR_SELF
}
/transfer.sh
$JOBDEF_TYPE
"
|
tee
-a
"
$JOB_LOGFILE
"
echo
"INFO:
$(
date
)
- Sending data to storage...
${
DIR_SELF
}
/transfer.sh
$JOBDEF_TYPE
"
|
tee
-a
"
$JOB_LOGFILE
"
touch
"
${
JOB_DONEFILE
}
.02.STARTTRANSFER"
touch
"
${
JOB_DONEFILE
}
.02.STARTTRANSFER"
# "${DIR_SELF}"/transfer.sh $JOBDEF_TYPE "$JOBDEF_AUTO" 2>&1 | tee -a "$JOB_LOGFILE"
# "${DIR_SELF}"/transfer.sh $JOBDEF_TYPE "$JOBDEF_AUTO" 2>&1 | tee -a "$JOB_LOGFILE"
...
...
This diff is collapsed.
Click to expand it.
plugins/transfer/restic.sh
+
0
−
2
View file @
b980df48
...
@@ -132,8 +132,6 @@
...
@@ -132,8 +132,6 @@
echo
"__REPO__ OK, Backup repository already exists."
echo
"__REPO__ OK, Backup repository already exists."
echo
"--- UNLOCK ... just in case :-)"
echo
"--- UNLOCK ... just in case :-)"
echo
restic unlock
${
ARGS_DEFAULT
}
color cmd
eval
restic unlock
${
ARGS_DEFAULT
}
eval
restic unlock
${
ARGS_DEFAULT
}
color reset
color reset
echo
echo
...
...
This diff is collapsed.
Click to expand it.
transfer.sh
+
60
−
61
View file @
b980df48
...
@@ -331,87 +331,86 @@ function setAction(){
...
@@ -331,87 +331,86 @@ function setAction(){
# --------------------------------------------------------------------------------
# --------------------------------------------------------------------------------
# ----- START BACKUPS
# ----- START BACKUPS
(
(
for
mydir
in
$sDirs2Backup
if
[
"
$ACTION
"
=
"backup"
]
;
then
do
for
mydir
in
$sDirs2Backup
do
# remove ending slash ... otherwise duplicity will fail
# remove ending slash ... otherwise duplicity will fail
mydir
=
`
echo
$mydir
|
sed
's#\/$##g'
`
mydir
=
`
echo
$mydir
|
sed
's#\/$##g'
`
if
[
-d
"
$mydir
"
]
;
then
if
[
-d
"
$mydir
"
]
;
then
BACKUP_DIR
=
$mydir
BACKUP_DIR
=
$mydir
if
[
"
$ACTION
"
=
"backup"
]
;
then
h2
"
`
date
`
STORE
$BACKUP_DIR
"
h2
"
`
date
`
STORE
$BACKUP_DIR
"
# --- build parameters
# --- build parameters
sSafeName
=
`
j_getSafename
"
$BACKUP_DIR
"
`
sSafeName
=
`
j_getSafename
"
$BACKUP_DIR
"
`
sTarget
=
"
$(
t_backupDirGetTarget
$BACKUP_DIR
)
"
sTarget
=
"
$(
t_backupDirGetTarget
$BACKUP_DIR
)
"
ARGS_BACKUP
=
"
${
sParamExclude
}
$(
t_getParamBackup
)
"
ARGS_BACKUP
=
"
${
sParamExclude
}
$(
t_getParamBackup
)
"
# detect custom backup sets and add its includes and excludes
# detect custom backup sets and add its includes and excludes
backupid
=
`
j_getSetnameOfPath
"
$BACKUP_DIR
"
`
backupid
=
`
j_getSetnameOfPath
"
$BACKUP_DIR
"
`
sSpaceReplace
=
"___SPACE___"
sSpaceReplace
=
"___SPACE___"
if
[
!
-z
$backupid
]
;
then
if
[
!
-z
$backupid
]
;
then
for
sItem
in
`
_j_getvar
${
DIRFILE
}
"
${
backupid
}
\-\-
include"
|
sed
"s#
\
#
${
sSpaceReplace
}
#g"
`
for
sItem
in
`
_j_getvar
${
DIRFILE
}
"
${
backupid
}
\-\-
include"
|
sed
"s#
\
#
${
sSpaceReplace
}
#g"
`
do
do
ARGS_BACKUP
=
"
${
ARGS_BACKUP
}
$(
t_getParamInlude
$sItem
)
"
ARGS_BACKUP
=
"
${
ARGS_BACKUP
}
$(
t_getParamInlude
$sItem
)
"
done
done
for
sItem
in
`
_j_getvar
${
DIRFILE
}
"
${
backupid
}
\-\-
exclude"
|
sed
"s#
\
#
${
sSpaceReplace
}
#g"
`
for
sItem
in
`
_j_getvar
${
DIRFILE
}
"
${
backupid
}
\-\-
exclude"
|
sed
"s#
\
#
${
sSpaceReplace
}
#g"
`
do
do
ARGS_BACKUP
=
"
${
ARGS_BACKUP
}
$(
t_getParamExlude
$sItem
)
"
ARGS_BACKUP
=
"
${
ARGS_BACKUP
}
$(
t_getParamExlude
$sItem
)
"
done
done
fi
fi
# --- pre task
# --- pre task
h3
"
`
date
`
PRE backup task for
${
BACKUP_DIR
}
"
h3
"
`
date
`
PRE backup task for
${
BACKUP_DIR
}
"
t_backupDirDoPreTasks
t_backupDirDoPreTasks
# sCmdPre="$( t_backupDirDoPreTasks )"
# sCmdPre="$( t_backupDirDoPreTasks )"
# --- backup
# --- backup
h3
"
`
date
`
Backup
${
BACKUP_DIR
}
"
h3
"
`
date
`
Backup
${
BACKUP_DIR
}
"
if
[
$doBackup
-eq
0
]
;
then
if
[
$doBackup
-eq
0
]
;
then
echo
"SKIP backup"
echo
"SKIP backup"
else
else
sCmd
=
"
$(
t_backupDirGetCmdBackup
)
"
sCmd
=
"
$(
t_backupDirGetCmdBackup
)
"
echo
"what:
${
BACKUP_DIR
}
"
echo
"what:
${
BACKUP_DIR
}
"
echo
"target:
${
sTarget
}
"
echo
"target:
${
sTarget
}
"
|
sed
's#:[^:]*@#:**********@#'
echo
"command:
$sCmd
"
echo
"command:
$sCmd
"
echo
echo
color cmd
color cmd
$sCmd
$sCmd
fetchrc
fetchrc
color reset
color reset
echo
echo
t_rcCheckBackup
$myrc
"
${
BACKUP_DIR
}
"
t_rcCheckBackup
$myrc
"
${
BACKUP_DIR
}
"
fi
fi
echo
echo
# --- post action
# --- post action
h3
"
`
date
`
POST backup task for
${
BACKUP_DIR
}
"
h3
"
`
date
`
POST backup task for
${
BACKUP_DIR
}
"
t_backupDirDoPostTasks
t_backupDirDoPostTasks
echo
echo
touch
${
lastbackupfile
}
touch
${
lastbackupfile
}
fi
else
else
color warning
color warning
echo
"DIR SKIP
$mydir
... does not exist (no error)"
echo
"DIR SKIP
$mydir
... does not exist (no error)"
color reset
color reset
fi
fi
echo
echo
done
done
fi
# --- prune
# --- prune
if
[
$doPrune
-eq
0
]
;
then
if
[
$doPrune
-eq
0
]
;
then
...
...
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