View Single Post
Posts: 566 | Thanked: 150 times | Joined on Dec 2007
#1
Hi all,

In order to find the cause of reboot loops I installed syslogkd. I can let it write logs to one of the SD cards. But after rebooting no new logs are written to it. I guess this is because the daemon tries to write the files before the SD card is mounted.

So my next idea was to automatically copy the logfiles from /var/log/ to the SD card as soon as it is mounted. But it won't work so far. To test using udev for this I have made these files:

/etc/udev/rules.d/91_backupsyslogs.rules :
Code:
KERNEL=="mmc1", RUN+="/usr/local/bin/backup_syslogs.sh"
/usr/local/bin/backup_syslogs.sh :
Code:
#!/bin/sh
if [ "${ACTION}" = "add" ] then
    datestring=`date '+%Y%m%d_%H%M%S'`
    echo "" > "/media/mmc1/test_${datestring}"
fi
When removing and inserting mmc1, or after rebooting no 'test..' file gets written to it like I would expect. Am I using the wrong string from "udevinfo -a -p /sys/block/mmcblk1" to test for in the .rules file? I have set the executable permission to both files. Are there better ways to do this?

Last edited by iamthewalrus; 2008-08-25 at 16:34.