Hello Snufkin,
Snufkin wrote: ↑15 Jan 2017 12:57
Thank you
crest, for good advice, Extended GUI is simple and straightforward way to make my own permanent log files based on temporary system files.
My original idea was to move files from temporary location in two hypothetical cases:
- reduce size of temporary in-memory file system and get free extra RAM,
- move constantly updated files from flash to rotational disks.
Ok, I dug a little bit in the sources and the solution is quite simple (but only for the UPS log unfortunately).
Open System > Advanced > rc.conf in the WebGUI and add a new variable
Code: Select all
name: nut_upslog_logfile
value: /mnt/YourDirectoryPath/ups.log
hit
Save and
Apply Changes and restart upslog in the CLI with
You should get a similar output like this:
Code: Select all
Stopping nut_upslog.
Waiting for PIDS: 60741.
Starting nut_upslog.
Network UPS Tools upslog 2.7.4
logging status of UPS@localhost to /mnt/DATA/ups-testlog.log (300s intervals)
If you want to see the output in
Diagnostics > Log just modify the user defined log file which is provided with the above mentioned beta of Extended GUI according to the value you used for the nut_upslog_logfile.
Unfortunately the described solution is not possible for the utx logs because their the path
/var/log is hardcoded in the file
/etc/rc.d/proftpd so if you want to change the path too than you must patch the file accordingly and restart proftpd as well. The bad thing here is that, if you use embedded installation, you must copy a patched file from a persistant location to /etc/rc.d/proftpd and restart proftpd with a postinit command which you can do in
System > Advanced > Command Scripts
And, as I understand it, N4F still lacks feature to reassign the storage location of ALL log files using ONE global variable.
Thats not (totally

) true, there is a global variable
clog_logdir you can use in
System > Advanced > rc.conf BUT, for some reasons - I suppose the idea was somehow a diffence between the file types
"type" => "clog" and
"type" => "plain", it is not used for all provided logs, as defined in
/usr/local/www/diag_log.inc
Code: Select all
// Get the location of the log files (may be modified via rc.conf variables).
$clogdir = rc_getenv_ex("clog_logdir", $g['varlog_path']);
$rsync_client_logfile = rc_getenv_ex("rsync_client_logfile", "{$g['varlog_path']}/rsync_client.log");
$rsync_local_logfile = rc_getenv_ex("rsync_local_logfile", "{$g['varlog_path']}/rsync_local.log");
$fuppes_logfile = rc_getenv_ex("fuppes_logfile", "{$g['varlog_path']}/fuppes.log");
$minidlna_logdir = rc_getenv_ex("minidlna_logdir", "{$g['varlog_path']}");
$minidlna_logfile = "$minidlna_logdir/minidlna.log";
$mtdaapd_logfile = rc_getenv_ex("mtdaapd_logfile", "{$g['varlog_path']}/mt-daapd.log");
$proftpd_modban_logfile = rc_getenv_ex("proftpd_modban_banlog", "{$g['varlog_path']}/proftpd/ban.log");
IMHO it would be more consistent to change the initial values from e.g.
Code: Select all
$rsync_client_logfile = rc_getenv_ex("rsync_client_logfile", "{$g['varlog_path']}/rsync_client.log");
to
Code: Select all
$rsync_client_logfile = rc_getenv_ex("rsync_client_logfile", "{$clogdir}/rsync_client.log");
because if one uses the global variable clog_logdir than this would be used also for
$rsync_client_logfile, $rsync_local_logfile, $fuppes_logfile, $minidlna_logdir etc. as default.
But it is up to the devs to change the logic ...
I hope this helps a bit
Regards
crest