Größe: 274
Kommentar:
|
Größe: 2249
Kommentar:
|
Gelöschter Text ist auf diese Art markiert. | Hinzugefügter Text ist auf diese Art markiert. |
Zeile 10: | Zeile 10: |
Jetzt noch das [[https://forum-raspberrypi.de/attachment/13356-varlog-aktuell-tar-gz/|varlog-Script]] aus [[https://forum-raspberrypi.de/forum/thread/29662-diskussion-fragen-var-log-in-eine-art-ramdisk-auslagern-weitere-optimierungen/?postID=282839#post282839|diesem Thread]] umsetzen! (Siehe Dateianhänge an dieser Seite) {{{ cat >> /etc/logrotate_varlog.conf << "EOFCONF" # see "man logrotate" for details # rotate log files weekly #daily # keep 4 weeks worth of backlogs rotate 7 # create new (empty) log files after rotating old ones create # uncomment this if you want your log files compressed compress # Logs are moved into directory for rotation olddir /var/archive # packages drop log rotation information into this directory #include /etc/logrotate.d /var/log_save/journal/8c5604e85c924195aef34a3e4079998d/system.journal { missingok notifempty } # system-specific logs may be configured here EOFCONF cat >> /etc/systemd/system/logrotate.service << "EOFSVC" [Unit] Description=Rotate log files Documentation=man:logrotate(8) man:logrotate.conf(5) ConditionACPower=true [Service] Type=oneshot ExecStart=/usr/sbin/logrotate /etc/logrotate_varlog.conf Nice=19 IOSchedulingClass=best-effort IOSchedulingPriority=7 EOFSVC cat >> /etc/systemd/system/logrotate.timer << "EOFTIMER" [Unit] Description=Daily rotation of log files Documentation=man:logrotate(8) man:logrotate.conf(5) [Timer] OnBootSec=2min Unit=logrotate.service [Install] WantedBy=timers.target EOFTIMER cat >> /etc/systemd/system/varlog.service << "EOFSERVICE" [Unit] Description=varlog.service: Redirect /var/log to tmpfs DefaultDependencies=no Before=local-fs.target shutdown.target Conflicts=umount.target [Service] Type=oneshot RemainAfterExit=yes ExecStart=/usr/local/bin/varlog start ExecStop=/usr/local/bin/varlog stop [Install] RequiredBy=systemd-journal-flush.service EOFSERVICE }}} |
Raspberry SD-Karte schonen
/var/log in eine RAMDisk auslagern:
In die /etc/fstab schreiben:
tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=50M 0 0
Jetzt noch das varlog-Script aus diesem Thread umsetzen! (Siehe Dateianhänge an dieser Seite)
cat >> /etc/logrotate_varlog.conf << "EOFCONF" # see "man logrotate" for details # rotate log files weekly #daily # keep 4 weeks worth of backlogs rotate 7 # create new (empty) log files after rotating old ones create # uncomment this if you want your log files compressed compress # Logs are moved into directory for rotation olddir /var/archive # packages drop log rotation information into this directory #include /etc/logrotate.d /var/log_save/journal/8c5604e85c924195aef34a3e4079998d/system.journal { missingok notifempty } # system-specific logs may be configured here EOFCONF cat >> /etc/systemd/system/logrotate.service << "EOFSVC" [Unit] Description=Rotate log files Documentation=man:logrotate(8) man:logrotate.conf(5) ConditionACPower=true [Service] Type=oneshot ExecStart=/usr/sbin/logrotate /etc/logrotate_varlog.conf Nice=19 IOSchedulingClass=best-effort IOSchedulingPriority=7 EOFSVC cat >> /etc/systemd/system/logrotate.timer << "EOFTIMER" [Unit] Description=Daily rotation of log files Documentation=man:logrotate(8) man:logrotate.conf(5) [Timer] OnBootSec=2min Unit=logrotate.service [Install] WantedBy=timers.target EOFTIMER cat >> /etc/systemd/system/varlog.service << "EOFSERVICE" [Unit] Description=varlog.service: Redirect /var/log to tmpfs DefaultDependencies=no Before=local-fs.target shutdown.target Conflicts=umount.target [Service] Type=oneshot RemainAfterExit=yes ExecStart=/usr/local/bin/varlog start ExecStop=/usr/local/bin/varlog stop [Install] RequiredBy=systemd-journal-flush.service EOFSERVICE
Swap abschalten:
systemctl disable dphys-swapfile