Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tetras-back
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
Service Desk
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
NoCloud
Tetras-back
Commits
bd0779da
Verified
Commit
bd0779da
authored
Sep 6, 2018
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Ajout d'une postcommande
parent
12c8622f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/scripts/backup_nocloud.sh
+12
-1
12 additions, 1 deletion
src/scripts/backup_nocloud.sh
with
12 additions
and
1 deletion
src/scripts/backup_nocloud.sh
+
12
−
1
View file @
bd0779da
...
...
@@ -165,6 +165,8 @@ usage(){
echo
" -w | --warnonly En cas d'erreur d'une action de sauvegarde,
le programme affiche un message mais ne
s'nterrompt pas"
echo
" -P | --Postcmd Execute la commande donnee apres la
sauvegarde"
}
dest
=
/mnt/backup
...
...
@@ -180,13 +182,14 @@ encfs=false
archive
=
false
MIN_SIZE
=
$((
1024
*
1024
))
warn_only
=
false
post_cmd
=
""
# Transform long options to short ones
for
arg
in
"
$@
"
;
do
shift
set
--
"
$@
"
`
echo
$arg
|
sed
's/^-\(-.\).*$/\1/'
`
done
optspec
=
":hvdcguws:mpe:i:a"
optspec
=
":hvdcguws:mpe:i:a
P:
"
while
getopts
"
$optspec
"
optchar
;
do
case
"
${
optchar
}
"
in
h
)
...
...
@@ -236,6 +239,9 @@ while getopts "$optspec" optchar; do
w
)
warn_only
=
true
;
;;
P
)
post_cmd
=
"
$OPTARG
"
;;
*
)
echo
"Option inconnue -
$optchar
"
usage
...
...
@@ -303,4 +309,9 @@ do_log "Resultats de la sauvegarde:"
du
-h
-d
1
$dest
/
df
-h
$dev
do_clean
if
[
!
-z
"
$post_cmd
"
]
then
do_log
"Execution de la commande post sauvegarde"
$post_cmd
fi
do_log
"Sauvegarde terminee le
`
date
`
"
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
sign in
to comment