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
Boxiang Sun
slapos
Commits
59646436
Commit
59646436
authored
Jun 15, 2023
by
Boxiang Sun
Committed by
Thomas Gambier
Feb 28, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
recipe/pbs: Update the rdiff-backup commands
parent
1199c4f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
slapos/recipe/pbs.py
slapos/recipe/pbs.py
+16
-6
No files found.
slapos/recipe/pbs.py
View file @
59646436
...
...
@@ -74,10 +74,10 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
export LC_ALL
RDIFF_BACKUP=%(rdiffbackup_binary)s
$RDIFF_BACKUP
\
\
--api-version 201
\
\
--remote-schema %(remote_schema)s
\
\
--restore-as-of now
\
\
--ignore-numerical-ids
\
\
--force
\
\
restore --at now
\
\
%(local_dir)s
\
\
%(remote_dir)s
"""
)
...
...
@@ -132,10 +132,10 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
CORRUPTED_ARGS=""
if [ "$1" = "--fix-corrupted" ]; then
VERIFY=$($RDIFF_BACKUP --verify $BACKUP_DIR 2>&1 >/dev/null)
VERIFY=$($RDIFF_BACKUP --
api-version 201
verify $BACKUP_DIR 2>&1 >/dev/null)
echo "$VERIFY" | egrep "$CORRUPTED_MSG" | sed "s/$CORRUPTED_MSG//g" > $CORRUPTED_FILE
# Sometimes
--
verify reports this spurious warning:
# Sometimes verify reports this spurious warning:
echo "$VERIFY" | egrep "$CANTFIND_MSG" | sed "s/$CANTFIND_MSG
\
(.*
\
),/--always-snapshot
\
'
\
\
1'/g" > $CANTFIND_FILE
# There can be too many files, better not to provide them through separate command line parameters
...
...
@@ -149,8 +149,10 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
fi
$RDIFF_BACKUP
\
\
--api-version 201
\
\
$CORRUPTED_ARGS
\
\
--remote-schema %(remote_schema)s
\
\
backup
\
\
%(remote_dir)s
\
\
$BACKUP_DIR
...
...
@@ -162,7 +164,7 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
# 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
$BACKUP_DIR
$RDIFF_BACKUP --
api-version 201 regress
$BACKUP_DIR
if [ ! $? -eq 0 ]; then
# Here, two possiblities:
if [ is_first_backup ]; then
...
...
@@ -178,9 +180,17 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
fi
else
# Everything's okay, cleaning up...
$RDIFF_BACKUP --remove-older-than %(remove_backup_older_than)s --force $BACKUP_DIR
echo "Cleaning backup directory..."
$RDIFF_BACKUP list increments $BACKUP_DIR
if [ ! $? -eq 0 ]; then
# There has some increments, do the cleaning
# XXX: How to check the increments is older than %(remove_backup_older_than)s?
$RDIFF_BACKUP --api-version 201 --force remove increments --older-than %(remove_backup_older_than)s $BACKUP_DIR
fi
fi
"""
)
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