#712 Issue closed: Have rear-$(hostname)-$WORKFLOW-.log in any case

Labels: discuss / RFC, fixed / solved / done

jsmeix opened issue at 2015-11-25 09:09:

Currently subsequent runs of "rear <workflow>"
keep exactly one old log file in a hardcoded way
in usr/sbin/rear

# Keep old log file:
if test -r "$LOGFILE" ; then
    mv -f "$LOGFILE" "$LOGFILE".old 2>&8
fi

Because of https://github.com/rear/rear/pull/709#issuecomment-159346698 I like to discuss here
whether or not this should be changed to use rear-$(hostname)-$WORKFLOW-.log in any case

The advantage is that unlimited old log files are kept.

The disadvantage is that unlimited old log files are kept
which could fill up the harddisk.

Perhaps the solution is to make the behaviour configurable
via usr/share/rear/conf/default.conf and voila! it is already there

LOGFILE="$LOG_DIR/rear-$HOSTNAME.log"

The admin can change this to

LOGFILE="$LOG_DIR/rear-$HOSTNAME-$WORKFLOW-$( date -Iseconds ).log"

Therefore from my point of view there is nothing to change here
and I set this issue initially to "fixed" and "waiting for feedback".

FYI:
With unique LOGFILE names like

LOGFILE="$LOG_DIR/rear-$( date -Iseconds ).log"

one does not get *.old copies because for each "rear" run
the new LOGFILE name does not already exist.

pavoldomin commented at 2015-11-25 09:51:

I support @jsmeix point, we should not modify the existing defaults: admins may have implemented some post-processing with the rear log file (parse it/copy it somewhere/...) and changing the default name would break that.

gdha commented at 2015-11-25 12:04:

Currently we have ./usr/share/rear/conf/default.conf:LOGFILE="$LOG_DIR/rear-$HOSTNAME.log" as a default. If there is a consensus to keep it as it is now then that is fine for me.
Others may have a different opinion, but then I would like to read it here...

jsmeix commented at 2015-11-25 12:45:

Because there is general agreement not to change
the default log file name, I close this issue.


[Export of Github issue for rear/rear.]