Skip to content
Snippets Groups Projects
Commit 3bcd09c2 authored by Jan Mach's avatar Jan Mach
Browse files

Fixed bug in mentat-backup script.

Wrong string literal used when generating backup shell command.
parent 94e817fe
No related branches found
No related tags found
No related merge requests found
......@@ -197,12 +197,12 @@ class MentatBackupScript(pyzenkit.zenscript.ZenScript):
(coll, ts_attr, system) = rule
if system:
self.logger.info("Performing backup of system collection '{}'".format(coll))
cmd = r"mongodump -o {} -d '{}' -c '{}'".format(dir_tmp, 'mentat', coll)
cmd = "mongodump -o {} -d '{}' -c '{}'".format(dir_tmp, 'mentat', coll)
result['dumpcommands'].append(cmd)
self.execute_command(cmd)
else:
self.logger.info("Performing backup of collection '{}'".format(coll))
cmd = r"mongodump -o {} -d '{}' -c '{}' -q '{{\"{}\": {{\"\$gte\": {}, \"\$lt\": {}}}}}'".format(dir_tmp, 'mentat', coll, ts_attr, time_l, time_h)
cmd = "mongodump -o {} -d '{}' -c '{}' -q '{{\"{}\": {{\"$gte\": {}, \"$lt\": {}}}}}'".format(dir_tmp, 'mentat', coll, ts_attr, time_l, time_h)
result['dumpcommands'].append(cmd)
self.execute_command(cmd)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment