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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Aurélien Vermylen
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
Hide 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,42 +114,50 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
...
@@ -114,42 +114,50 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
export LC_ALL
export LC_ALL
is_first_backup=$(test -d %(rdiff_backup_data)s || echo yes)
is_first_backup=$(test -d %(rdiff_backup_data)s || echo yes)
RDIFF_BACKUP=%(rdiffbackup_binary)s
RDIFF_BACKUP=%(rdiffbackup_binary)s
$RDIFF_BACKUP
\
\
SUCCEEDED=false
--remote-schema %(remote_schema)s
\
\
while ! $SUCCEEDED; do
%(remote_dir)s
\
\
$RDIFF_BACKUP
\
\
%(local_dir)s
--remote-schema %(remote_schema)s
\
\
%(remote_dir)s
\
\
if [ ! $? -eq 0 ]; then
%(local_dir)s
# Check the backup, go to the last consistent backup, so that next
# run will be okay.
echo "Checking backup directory..."
$RDIFF_BACKUP --check-destination-dir %(local_dir)s
if [ ! $? -eq 0 ]; then
if [ ! $? -eq 0 ]; then
# Here, two possiblities:
# Check the backup, go to the last consistent backup, so that next
if [ is_first_backup ]; then
# run will be okay.
:
echo "Checking backup directory..."
# The first backup failed, and check-destination as well.
$RDIFF_BACKUP --check-destination-dir %(local_dir)s
# we may want to remove the backup.
if [ ! $? -eq 0 ]; then
else
# Here, two possiblities:
:
if [ is_first_backup ]; then
# The backup command has failed, while transferring an increment, and check-destination as well.
continue
# XXX We may need to publish the failure and ask the the equeue, re-run this script again,
# The first backup failed, and check-destination as well.
# instead do a push to the clone.
# 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.
fi
fi
fi
else
# Everything's okay, cleaning up...
$RDIFF_BACKUP --remove-older-than %(remove_backup_older_than)s --force %(local_dir)s
fi
fi
else
# Everything's okay, cleaning up...
SUCCEEDED=true
$RDIFF_BACKUP --remove-older-than %(remove_backup_older_than)s --force %(local_dir)s
fi
if [ -e %(backup_signature)s ]; then
cd %(local_dir)s
if [ -e %(backup_signature)s ]; then
find -type f ! -name backup.signature ! -wholename "./rdiff-backup-data/*" -print0 | xargs -P4 -0 sha256sum | LC_ALL=C sort -k 66 > ../proof.signature
cd %(local_dir)s
cmp backup.signature ../proof.signature || SUCCEEDED=false
find -type f ! -name backup.signature ! -wholename "./rdiff-backup-data/*" -print0 | xargs -P4 -0 sha256sum | LC_ALL=C sort -k 66 > ../proof.signature
diff -ruw backup.signature ../proof.signature > ../backup.diff
diff -ruw backup.signature ../proof.signature > ../backup.diff
# XXX If there is a difference on the backup, we should publish the
# XXX If there is a difference on the backup, we should publish the
# failure and ask the equeue, re-run this script again,
# failure and ask the equeue, re-run this script again,
# instead do a push it to the clone.
# instead do a push it to the clone.
fi
fi
$SUCCEEDED || find %(local_dir)s -name rdiff-backup.tmp.* -exec rm -f {}
\
;
done
"""
)
"""
)
template_dict
=
{
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