Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
6b586ebf
Commit
6b586ebf
authored
Nov 07, 2017
by
Mathieu Giraud
Browse files
server/backup.sh: -i, add option
See vdj#531.
parent
f5af8ae0
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/backup.sh
View file @
6b586ebf
#!/bin/sh
COMPLETE
=
0
INCREMENTAL
=
0
DIR
=
if
[
$#
-ge
1
-a
"
$1
"
=
"-h"
]
;
then
echo
"
$0
: [-c] [path]
echo
"
$0
: [-c]
[-i]
[path]
-c: Backup everything
-i: Incremental backup, since the first of the month
path: Where to save the file"
>
&2
exit
1
fi
if
[
$#
-ge
1
-a
"
$1
"
=
"-i"
]
;
then
INCREMENTAL
=
1
shift
fi
if
[
$#
-ge
1
-a
"
$1
"
=
"-c"
]
;
then
COMPLETE
=
1
shift
...
...
@@ -40,8 +47,11 @@ if [ $COMPLETE -eq 1 ]; then
filename
=
"
${
DIR
}
backup_"
$now
zip
-r
$filename
web2py/applications/vidjil/databases/
"
$DIR_SEQUENCES
"
"
$DIR_RESULTS
"
$db_backup_file
else
if
[
$INCREMENTAL
-eq
1
]
;
then
else
filename
=
"
${
DIR
}
backup_essentials_"
$now
zip
-r
$filename
web2py/applications/vidjil/databases/
"
$DIR_RESULTS
"
$db_backup_file
fi
fi
rm
-f
"
$db_backup_file
"
ls
-lh
$filename
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment