Move history files to /var

According to this forum thread (https://www.virtualmin.com/node/18623) and my research in config files is no way to setup specific folder to saving history files. Actually Cloudmin is saving these files in /etc/webmin/server-manager/history, but these files is logs files of virtual machines. It's really necessary to change default history folder to /var (as many other software), for example to /var/webmin/server-manager/history.

I installed whole root filesystem to flash drive (except /var, /tmp...) and this permanent writing to /etc is destroying my drive.

Status: 
Active

Comments

My suggestion: in /usr/share/webmin/server-manager/server-manager-lib.pl change: $historic_info_dir = "$module_config_directory/history"; to: $historic_info_dir = "$ENV{'WEBMIN_VAR'}/$module_name/history";

And it would be very useful to check all cloudmin/webmin destinations (probably stored in server-manager-lib.pl) and move some files and folders to /tmp or /var/webmin.

The best way of making this move would be to just move/etc/webmin/server-manager/history to /var/webmin/history , and then create a symbolic link from the old to the new location. This will work better than your code change, as it won't be over-ridden if Cloudmin is upgraded.

You're right, I did it before I wrote about this bug. But I would like to see this change ib official Cloudmin releases. Can You commit this?

I'd rather not change this - historically Webmin has used /var/ for logs and temp files that can be deleted, and /etc for permanent records. But you can change it on your system as suggested above if necessary.

I think that historical data are like logs and can be deleted without any damage. I'd recommend to think about it.

Thank You.

They are more than logs though - they are used to render the graphs of CPU/RAM/disk usage over time in Cloudmin.

Can you tell me more about how this is harming the SSD in your system?

According to my knowledge all used services use /var to save any variable data and /etc to store configuration only (can be modified by users only). /var is used by mysql to save all databases, bind to save all DNS records, ZABBIX monitoring system to gather all data from servers and etc. So Cloudmin history/graphs data should be stored in /var.

I don't use SSD, but simple USB flash drive to create something like cheap read-only hypervisor. So frequent writing to root is harming flash drive and destroy it in a few months.