Commit 02973bbb authored by Nicolas Wavrant's avatar Nicolas Wavrant

pbs: remove infinite loops from pbs scripts.

Instead, of that, the notifier wrappers will run the scripts several more times in case of failures
This is better than silent failures.
parent c08a6567
...@@ -82,7 +82,7 @@ class Recipe(GenericSlapRecipe, Notify, Callback): ...@@ -82,7 +82,7 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
LC_ALL=C LC_ALL=C
export LC_ALL export LC_ALL
RDIFF_BACKUP=%(rdiffbackup_binary)s RDIFF_BACKUP=%(rdiffbackup_binary)s
until $RDIFF_BACKUP \\ $RDIFF_BACKUP \\
--remote-schema %(remote_schema)s \\ --remote-schema %(remote_schema)s \\
--restore-as-of now \\ --restore-as-of now \\
--force \\ --force \\
...@@ -90,7 +90,6 @@ class Recipe(GenericSlapRecipe, Notify, Callback): ...@@ -90,7 +90,6 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
%(remote_dir)s; do %(remote_dir)s; do
echo "repeating rdiff-backup..." echo "repeating rdiff-backup..."
sleep 10 sleep 10
done
""") """)
template_dict = { template_dict = {
...@@ -137,7 +136,6 @@ class Recipe(GenericSlapRecipe, Notify, Callback): ...@@ -137,7 +136,6 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
CANTFIND_FILE=$TMPDIR/$$.rdiff_cantfind CANTFIND_FILE=$TMPDIR/$$.rdiff_cantfind
SUCCEEDED=false SUCCEEDED=false
while ! $SUCCEEDED; do
# not using --fix-corrupted can lead to an infinite loop # not using --fix-corrupted can lead to an infinite loop
# in case of manual changes to the backup repository. # in case of manual changes to the backup repository.
...@@ -206,7 +204,7 @@ class Recipe(GenericSlapRecipe, Notify, Callback): ...@@ -206,7 +204,7 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
fi fi
$SUCCEEDED || find $BACKUP_DIR -name rdiff-backup.tmp.* -exec rm -rf {} \; $SUCCEEDED || find $BACKUP_DIR -name rdiff-backup.tmp.* -exec rm -rf {} \;
done
""") """)
template_dict = { template_dict = {
...@@ -305,6 +303,7 @@ class Recipe(GenericSlapRecipe, Notify, Callback): ...@@ -305,6 +303,7 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
title=entry.get('title', slave_id), title=entry.get('title', slave_id),
notification_url=entry['notify'] or '', notification_url=entry['notify'] or '',
feed_url='%s/get/%s' % (self.options['notifier-url'], entry['notification-id']), feed_url='%s/get/%s' % (self.options['notifier-url'], entry['notification-id']),
max_run=self.options.get('pull-push-maximum-run', 1),
pidfile=os.path.join(self.options['run-directory'], '%s.pid' % slave_id), pidfile=os.path.join(self.options['run-directory'], '%s.pid' % slave_id),
instance_root_name=self.options.get('instance-root-name', None), instance_root_name=self.options.get('instance-root-name', None),
log_url=self.options.get('log-url', None), log_url=self.options.get('log-url', None),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment