armbian清理_N1盒子armbian/ubuntu/linux系统修改日志输出到内存

N1盒子的存储设备是emmc,为了延长emmc的使用寿命尽可能的将读写文件在内存中完成。

修改systemd journald日志存放目录为内存,也就是/run/log目录,限制最大使用内存空间64MB:sed -i 's/#Storage=auto/Storage=volatile/' /etc/systemd/journald.conf

sed -i 's/#RuntimeMaxUse=/RuntimeMaxUse=64M/' /etc/systemd/journald.conf

然后重新启动systemd-journald服务:systemctl restart systemd-journald

修改rsyslog日志存放目录为/run/log:sed -i 's/\/var\/log/\/run\/log/g' /etc/rsyslog.d/50-default.conf

修改rsyslog运行用户为root,不然/run/log没写入权限:sed 's/PrivDropToUser syslog/PrivDropToUser root/' /etc/rsyslog.conf

sed 's/PrivDropToUser syslog/PrivDropToGroup root/' /etc/rsyslog.conf

然后重启rsyslog即可:systemctl restart rsyslog

修改nginx日志目录:sed -i 's/\/var\/log/\/run\/log/g' /etc/nginx/nginx.conf

mkdir /run/log/nginx

systemctl restart nginx

修改php-fp

你可能感兴趣的:(armbian清理)