YunoHost-Apps / borg_ynh

An experimental Borg implementation for YunoHost
https://www.borgbackup.org/
GNU Affero General Public License v3.0
19 stars 23 forks source link

No output in /var/log/backup_borg.log #26

Closed BCITMike closed 3 years ago

BCITMike commented 5 years ago

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.

eauchat commented 4 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

eauchat commented 3 years ago

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.

eauchat commented 3 years ago

I guess this issue can be closed now that #55 has been merged.