Closed BCITMike closed 3 years ago
Same here, I also have no logs in /var/log/backup_borg.log while there are some in /var/log/backup_borg.err
Looking a bit deeper in borg_ynh code and borg documentation. It seems to make sense that there are no logs in /var/log/backup_borg.log
.
From borg manpage:
Borg writes all log output to stderr by default. But please note that something showing up on stderr does not indicate an error condition just because it is on stderr. Please check the log levels of the messages and the return code of borg for determining error, warning or success conditions. If you want to capture the log output to a file, just redirect it:
borg create repo::archive myfiles 2>> logfile
Output level can be customized via the BORG_LOGGING_CONF environment variable, but it doesn't seem to allow to change where the logs are actually sent.
So it doesn't seem useful to have the >> $LOGFILE
part in borg [init/create/prune/mount] ... >> $LOGFILE 2>> $ERRFILE
lines.
Also, for the second thing mentioned by @BCITMike, the timestamps, I didn't find anything in borg documentation that would enable that. But this can be achieved with a bit of bash syntax.
I proposed a patch to solve those two issues #55.
I guess this issue can be closed now that #55 has been merged.
I do get errors in /var/log/backup_borg.err, but not in backup_borg.log. I am expecting to be able to tail that file and see what borg is doing. Right?
Also, it would be good to use the current_date variable to add timestamps to the log files.