Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
backupninja
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Liberate
backupninja
Commits
f896ef3f
Commit
f896ef3f
authored
13 years ago
by
intrigeri
Browse files
Options
Downloads
Patches
Plain Diff
dup: add precmd to every duplicity call.
parent
357a17b1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
handlers/dup.in
+9
-8
9 additions, 8 deletions
handlers/dup.in
with
9 additions
and
8 deletions
handlers/dup.in
+
9
−
8
View file @
f896ef3f
...
@@ -95,6 +95,7 @@ fi
...
@@ -95,6 +95,7 @@ fi
### COMMAND-LINE MANGLING ######################################################
### COMMAND-LINE MANGLING ######################################################
### initialize $execstr*
### initialize $execstr*
execstr_precmd
=
execstr_command
=
execstr_command
=
execstr_options
=
"
$options
--no-print-statistics"
execstr_options
=
"
$options
--no-print-statistics"
execstr_source
=
execstr_source
=
...
@@ -261,13 +262,13 @@ fi
...
@@ -261,13 +262,13 @@ fi
### Cleanup commands (duplicity >= 0.4.4)
### Cleanup commands (duplicity >= 0.4.4)
# cleanup
# cleanup
debug
"duplicity cleanup --force
$execstr_options
$execstr_serverpart
"
debug
"
$execstr_precmd
duplicity cleanup --force
$execstr_options
$execstr_serverpart
"
if
[
!
$test
]
;
then
if
[
!
$test
]
;
then
export
PASSPHRASE
=
$password
export
PASSPHRASE
=
$password
export
FTP_PASSWORD
=
$ftp_password
export
FTP_PASSWORD
=
$ftp_password
output
=
`
nice
-n
$nicelevel
\
output
=
`
nice
-n
$nicelevel
\
su
-c
\
su
-c
\
"duplicity cleanup --force
$execstr_options
$execstr_serverpart
2>&1"
`
"
$execstr_precmd
duplicity cleanup --force
$execstr_options
$execstr_serverpart
2>&1"
`
exit_code
=
$?
exit_code
=
$?
if
[
$exit_code
-eq
0
]
;
then
if
[
$exit_code
-eq
0
]
;
then
debug
$output
debug
$output
...
@@ -280,13 +281,13 @@ fi
...
@@ -280,13 +281,13 @@ fi
# remove-older-than
# remove-older-than
if
[
"
$keep
"
!=
"yes"
]
;
then
if
[
"
$keep
"
!=
"yes"
]
;
then
debug
"duplicity remove-older-than
$keep
--force
$execstr_options
$execstr_serverpart
"
debug
"
$execstr_precmd
duplicity remove-older-than
$keep
--force
$execstr_options
$execstr_serverpart
"
if
[
!
$test
]
;
then
if
[
!
$test
]
;
then
export
PASSPHRASE
=
$password
export
PASSPHRASE
=
$password
export
FTP_PASSWORD
=
$ftp_password
export
FTP_PASSWORD
=
$ftp_password
output
=
`
nice
-n
$nicelevel
\
output
=
`
nice
-n
$nicelevel
\
su
-c
\
su
-c
\
"duplicity remove-older-than
$keep
--force
$execstr_options
$execstr_serverpart
2>&1"
`
"
$execstr_precmd
duplicity remove-older-than
$keep
--force
$execstr_options
$execstr_serverpart
2>&1"
`
exit_code
=
$?
exit_code
=
$?
if
[
$exit_code
-eq
0
]
;
then
if
[
$exit_code
-eq
0
]
;
then
debug
$output
debug
$output
...
@@ -302,13 +303,13 @@ fi
...
@@ -302,13 +303,13 @@ fi
if
[
"
$keep
"
!=
"yes"
]
;
then
if
[
"
$keep
"
!=
"yes"
]
;
then
if
[
"
$keepincroffulls
"
!=
"all"
]
;
then
if
[
"
$keepincroffulls
"
!=
"all"
]
;
then
if
[
"
$duplicity_major
"
-ge
0
-a
"
$duplicity_minor
"
-ge
6
-a
"
$duplicity_sub
"
-ge
10
]
;
then
if
[
"
$duplicity_major
"
-ge
0
-a
"
$duplicity_minor
"
-ge
6
-a
"
$duplicity_sub
"
-ge
10
]
;
then
debug
"
$precmd
duplicity remove-all-inc-of-but-n-full
$keepincroffulls
--force
$execstr_options
$execstr_serverpart
"
debug
"
$
execstr_
precmd
duplicity remove-all-inc-of-but-n-full
$keepincroffulls
--force
$execstr_options
$execstr_serverpart
"
if
[
!
$test
]
;
then
if
[
!
$test
]
;
then
export
PASSPHRASE
=
$password
export
PASSPHRASE
=
$password
export
FTP_PASSWORD
=
$ftp_password
export
FTP_PASSWORD
=
$ftp_password
output
=
`
nice
-n
$nicelevel
\
output
=
`
nice
-n
$nicelevel
\
su
-c
\
su
-c
\
"
$precmd
duplicity remove-all-inc-of-but-n-full
$keepincroffulls
--force
$execstr_options
$execstr_serverpart
2>&1"
`
"
$
execstr_
precmd
duplicity remove-all-inc-of-but-n-full
$keepincroffulls
--force
$execstr_options
$execstr_serverpart
2>&1"
`
exit_code
=
$?
exit_code
=
$?
if
[
$exit_code
-eq
0
]
;
then
if
[
$exit_code
-eq
0
]
;
then
debug
$output
debug
$output
...
@@ -323,14 +324,14 @@ if [ "$keep" != "yes" ]; then
...
@@ -323,14 +324,14 @@ if [ "$keep" != "yes" ]; then
fi
fi
### Backup command
### Backup command
debug
"duplicity
$execstr_command
$execstr_options
$execstr_source
--exclude '**' /
$execstr_serverpart
"
debug
"
$execstr_precmd
duplicity
$execstr_command
$execstr_options
$execstr_source
--exclude '**' /
$execstr_serverpart
"
if
[
!
$test
]
;
then
if
[
!
$test
]
;
then
outputfile
=
`
maketemp backupout
`
outputfile
=
`
maketemp backupout
`
export
PASSPHRASE
=
$password
export
PASSPHRASE
=
$password
export
FTP_PASSWORD
=
$ftp_password
export
FTP_PASSWORD
=
$ftp_password
output
=
`
nice
-n
$nicelevel
\
output
=
`
nice
-n
$nicelevel
\
su
-c
\
su
-c
\
"duplicity
$execstr_command
$execstr_options
$execstr_source
--exclude '**' /
$execstr_serverpart
>
$outputfile
2>&1"
`
"
$execstr_precmd
duplicity
$execstr_command
$execstr_options
$execstr_source
--exclude '**' /
$execstr_serverpart
>
$outputfile
2>&1"
`
exit_code
=
$?
exit_code
=
$?
debug
$output
debug
$output
cat
$outputfile
|
(
while
read
output
;
do
cat
$outputfile
|
(
while
read
output
;
do
...
...
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