-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Invalid escape sequences #1352
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -423,7 +423,7 @@ def restore(self, | |
restore to original destiantion | ||
delete (bool): delete newer files which are not in the | ||
snapshot | ||
backup (bool): create backup files (\*.backup.YYYYMMDD) | ||
backup (bool): create backup files (*.backup.YYYYMMDD) | ||
before changing or deleting local files. | ||
only_new (bool): Only restore files which does not exist | ||
or are newer than those in destination. | ||
|
@@ -1405,22 +1405,25 @@ def smartRemove(self, del_snapshots, log = None): | |
additionalChars = len(self.config.sshPrefixCmd(cmd_type = str)) | ||
|
||
head = 'screen -d -m bash -c "(' | ||
head += 'TMP=\$(mktemp -d); ' #create temp dir used for delete files with rsync | ||
head += 'test -z \\\"\$TMP\\\" && exit 1; ' #make sure $TMP dir was created | ||
head += 'test -n \\\"\$(ls \$TMP)\\\" && exit 1; ' #make sure $TMP is empty | ||
# create temp dir used for delete files with rsync | ||
head += 'TMP=\\$(mktemp -d); ' | ||
# make sure $TMP dir was created | ||
head += 'test -z \\\"\\$TMP\\\" && exit 1; ' | ||
# make sure $TMP is empty | ||
head += 'test -n \\\"\\$(ls \\$TMP)\\\" && exit 1; ' | ||
if logger.DEBUG: | ||
head += 'logger -t \\\"backintime smart-remove [$BASHPID]\\\" \\\"start\\\"; ' | ||
head += 'flock -x 9; ' | ||
if logger.DEBUG: | ||
head += 'logger -t \\\"backintime smart-remove [$BASHPID]\\\" \\\"got exclusive flock\\\"; ' | ||
|
||
tail = 'rmdir \$TMP) 9>\\\"%s\\\""' %lckFile | ||
tail = 'rmdir \\$TMP) 9>\\\"%s\\\""' %lckFile | ||
|
||
cmds = [] | ||
for sid in del_snapshots: | ||
remote = self.rsyncRemotePath(sid.path(use_mode = ['ssh', 'ssh_encfs']), use_mode = [], quote = '\\\"') | ||
rsync = ' '.join(tools.rsyncRemove(self.config, run_local = False)) | ||
rsync += ' \\\"\$TMP/\\\" {}; '.format(remote) | ||
rsync += ' \\\"\\$TMP/\\\" {}; '.format(remote) | ||
|
||
s = 'test -e \\\"%s\\\" && (' %sid.path(use_mode = ['ssh', 'ssh_encfs']) | ||
if logger.DEBUG: | ||
|
@@ -1634,7 +1637,7 @@ def statFreeSpaceSsh(self): | |
# /tmp 127266564 115596412 5182296 96% / | ||
# ^^^^^^^ | ||
for line in output.split(b'\n'): | ||
m = re.match(b'^.*?\s+\d+\s+\d+\s+(\d+)\s+\d+%', line, re.M) | ||
m = re.match(r'^.*?\s+\d+\s+\d+\s+(\d+)\s+\d+%', line.decode(), re.M) | ||
Comment on lines
-1637
to
+1640
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The output from shell was catched as binary instead of a string. No need for that. |
||
|
||
if m: | ||
return int(int(m.group(1)) / 1024) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry the diff here is hard to see.
In all three lines the
\$
was modified to\\$
.