Last active
January 7, 2024 14:06
-
-
Save uyorum/735f396d0229ebfc80546deead7f19df to your computer and use it in GitHub Desktop.
Enable read-only sdcard on Octopi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
echo "Stopping log emiting services..." | |
systemctl stop syslog.socket | |
systemctl stop rsyslog | |
systemctl stop octoprint | |
systemctl stop klipper | |
echo "Removing log files..." | |
find /var/log -type f -regextype posix-egrep -regex '.*\.[0-9]+(\.gz)?' | |
find /var/log -type f -exec truncate -s 0 {} \; | |
truncate -s 0 /tmp/klippy.log | |
find /home/pi/.octoprint/logs -type f -regextype posix-egrep -regex '.*\.log\..+' -delete | |
find /home/pi/.octoprint/logs -type f -exec truncate -s 0 {} \; | |
echo "Enabling read-only SDcard..." | |
raspi-config nonint enable_overlayfs | |
echo "Finish. Reboot to apply" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment