Jump to content

Save syslog


0jf5

Recommended Posts

throw this in /etc/rc.local, or make an init script, and/or throw a wrapper around it to make it persistant. Syslog data is currently only saved in memory which is limited to 0-XMB depending on what you're doing. This will throw everything into an actual log file and retain data after reboot. Code is probbaly ugly but made sense at 2am and seems to work:

#!/bin/sh
#Change whatever paths and filenames you want, feel free to modify as needed
sdcard="/sd"
log="$sdcard"/syslog/syslog

if [ ! -d "$sdcard" ]; then
    echo "Please mount your sd card and set the \"sdcard\" variable"
elif
    [ ! -d "$sdcard"/syslog ]; then
        mkdir "$sdcard"/syslog
            if [ -e "$log" ]; then
                /sbin/logread -f >> "$log"
            else
                /sbin/logread > "$log"
                /sbin/logread -f >> "$log"
            fi
else
    if [ -e "$log" ]; then
        /sbin/logread -f >> "$log"
    else
        /sbin/logread > "$log"
        /sbin/logread -f >> "$log"
    fi
fi
Edited by 0jf5
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...