Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Leymonerie
slapos
Commits
90005dd4
Commit
90005dd4
authored
Oct 06, 2014
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pbs: repeat pull loop until succeeded
parent
6e3852de
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
33 deletions
+41
-33
slapos/recipe/pbs.py
slapos/recipe/pbs.py
+41
-33
No files found.
slapos/recipe/pbs.py
View file @
90005dd4
...
...
@@ -114,6 +114,8 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
export LC_ALL
is_first_backup=$(test -d %(rdiff_backup_data)s || echo yes)
RDIFF_BACKUP=%(rdiffbackup_binary)s
SUCCEEDED=false
while ! $SUCCEEDED; do
$RDIFF_BACKUP
\
\
--remote-schema %(remote_schema)s
\
\
%(remote_dir)s
\
\
...
...
@@ -127,11 +129,11 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
if [ ! $? -eq 0 ]; then
# Here, two possiblities:
if [ is_first_backup ]; then
:
continue
# The first backup failed, and check-destination as well.
# we may want to remove the backup.
else
:
continue
# The backup command has failed, while transferring an increment, and check-destination as well.
# XXX We may need to publish the failure and ask the the equeue, re-run this script again,
# instead do a push to the clone.
...
...
@@ -142,14 +144,20 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
$RDIFF_BACKUP --remove-older-than %(remove_backup_older_than)s --force %(local_dir)s
fi
SUCCEEDED=true
if [ -e %(backup_signature)s ]; then
cd %(local_dir)s
find -type f ! -name backup.signature ! -wholename "./rdiff-backup-data/*" -print0 | xargs -P4 -0 sha256sum | LC_ALL=C sort -k 66 > ../proof.signature
cmp backup.signature ../proof.signature || SUCCEEDED=false
diff -ruw backup.signature ../proof.signature > ../backup.diff
# XXX If there is a difference on the backup, we should publish the
# failure and ask the equeue, re-run this script again,
# instead do a push it to the clone.
fi
$SUCCEEDED || find %(local_dir)s -name rdiff-backup.tmp.* -exec rm -f {}
\
;
done
"""
)
template_dict
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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