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
2f4a9bcb
Commit
2f4a9bcb
authored
2 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
remove unneeded Skips of non existing dirs
parent
4fdff636
No related branches found
No related tags found
1 merge request
!79
Finetune output
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
transfer.sh
+60
-61
60 additions, 61 deletions
transfer.sh
with
60 additions
and
61 deletions
transfer.sh
+
60
−
61
View file @
2f4a9bcb
...
@@ -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
}
"
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