How to stop python-based borg backup from logging with ^M

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I'm trying to make a log file for monitoring backup progress using borg deduplicating archiver. While I am logging, the file contains ^M control characters for each line despite running the script on linux. Is there a means to prevent borg from outputting in this format in the log file?



I tried piping the output (using |&) to tr -d '^M' before &>> to the log file, but in that case, while borg now displays a running status on the terminal, either nothing actually get's written to the log file in that case.



Alternatively, I've tried `tr -d 'r' in the hopes that it would keep new lines. In that case, the log file becomes just one big single line.







share|improve this question


















  • 1




    You can try sed -i 's/r/n/g' FILENAME, if you have the GNU version of sed, which you probably do on Linux. It won't fix the live output, but it'll fix newlines in the old output. If you don't have GNU sed, you can use perl: perl -i -pe 's/r/n/g' FILENAME.
    – dogoncouch
    Mar 31 at 18:44














up vote
1
down vote

favorite












I'm trying to make a log file for monitoring backup progress using borg deduplicating archiver. While I am logging, the file contains ^M control characters for each line despite running the script on linux. Is there a means to prevent borg from outputting in this format in the log file?



I tried piping the output (using |&) to tr -d '^M' before &>> to the log file, but in that case, while borg now displays a running status on the terminal, either nothing actually get's written to the log file in that case.



Alternatively, I've tried `tr -d 'r' in the hopes that it would keep new lines. In that case, the log file becomes just one big single line.







share|improve this question


















  • 1




    You can try sed -i 's/r/n/g' FILENAME, if you have the GNU version of sed, which you probably do on Linux. It won't fix the live output, but it'll fix newlines in the old output. If you don't have GNU sed, you can use perl: perl -i -pe 's/r/n/g' FILENAME.
    – dogoncouch
    Mar 31 at 18:44












up vote
1
down vote

favorite









up vote
1
down vote

favorite











I'm trying to make a log file for monitoring backup progress using borg deduplicating archiver. While I am logging, the file contains ^M control characters for each line despite running the script on linux. Is there a means to prevent borg from outputting in this format in the log file?



I tried piping the output (using |&) to tr -d '^M' before &>> to the log file, but in that case, while borg now displays a running status on the terminal, either nothing actually get's written to the log file in that case.



Alternatively, I've tried `tr -d 'r' in the hopes that it would keep new lines. In that case, the log file becomes just one big single line.







share|improve this question














I'm trying to make a log file for monitoring backup progress using borg deduplicating archiver. While I am logging, the file contains ^M control characters for each line despite running the script on linux. Is there a means to prevent borg from outputting in this format in the log file?



I tried piping the output (using |&) to tr -d '^M' before &>> to the log file, but in that case, while borg now displays a running status on the terminal, either nothing actually get's written to the log file in that case.



Alternatively, I've tried `tr -d 'r' in the hopes that it would keep new lines. In that case, the log file becomes just one big single line.









share|improve this question













share|improve this question




share|improve this question








edited Mar 31 at 16:01

























asked Mar 31 at 15:32









wdkrnls

227314




227314







  • 1




    You can try sed -i 's/r/n/g' FILENAME, if you have the GNU version of sed, which you probably do on Linux. It won't fix the live output, but it'll fix newlines in the old output. If you don't have GNU sed, you can use perl: perl -i -pe 's/r/n/g' FILENAME.
    – dogoncouch
    Mar 31 at 18:44












  • 1




    You can try sed -i 's/r/n/g' FILENAME, if you have the GNU version of sed, which you probably do on Linux. It won't fix the live output, but it'll fix newlines in the old output. If you don't have GNU sed, you can use perl: perl -i -pe 's/r/n/g' FILENAME.
    – dogoncouch
    Mar 31 at 18:44







1




1




You can try sed -i 's/r/n/g' FILENAME, if you have the GNU version of sed, which you probably do on Linux. It won't fix the live output, but it'll fix newlines in the old output. If you don't have GNU sed, you can use perl: perl -i -pe 's/r/n/g' FILENAME.
– dogoncouch
Mar 31 at 18:44




You can try sed -i 's/r/n/g' FILENAME, if you have the GNU version of sed, which you probably do on Linux. It won't fix the live output, but it'll fix newlines in the old output. If you don't have GNU sed, you can use perl: perl -i -pe 's/r/n/g' FILENAME.
– dogoncouch
Mar 31 at 18:44















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f434691%2fhow-to-stop-python-based-borg-backup-from-logging-with-m%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f434691%2fhow-to-stop-python-based-borg-backup-from-logging-with-m%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?