Yes, everything in the code box in post #6 should be cut'n'pasted into /jffs/scripts/syslog_move.sh
There should be no need to change the source???
To make my syslog move script 'portable' I documented/included a base init-start script as a comment header within the syslog_move.sh script.
..but to make it even easier I have expanded the comments as code, so simply cut'n'paste everything in this code box to /jffs/scripts/init-start (assuming of course that you don't already have an existing init-start script! )
Code:#!/bin/sh /usr/bin/logger -s -t "($(basename $0))" $$ "Martineau $MYROUTER BOOT in progress... [$@]" MYROUTER=$(nvram get computer_name) HARDWARE_MODEL=$(nvram get productid) BUILDNO=$(nvram get buildno) EXTENDNO=$(nvram get extendno) # NOTE: Can't use Flash drive /tmp/mnt/$MYROUTER/ 'cos it hasn't been mounted yet :-( # 'flock' is probably a better solution rather than the 'echo' ;-) echo $$"-"`date` > /tmp/BOOTINPROGRESS # Should be sufficient to cover physical BOOT process? logger -st "($(basename $0))" $$ "Paused for 3 mins....." sleep 180 # call custom scripts/commands e.g. cifs.sh / cru etc. here... # Move Syslog to USB Flash drive /jffs/scripts/syslog-move.sh rm /tmp/BOOTINPROGRESS /usr/bin/logger -st "($(basename $0))" $$ "Martineau" $MYROUTER "BOOT Completed Firmware build" $BUILDNO $EXTENDNO "[$@]" exit 0
Thanks. Looks easy enough. Carried out all instructions. One small issue (or big). I don't have the syslog.log file anymore within the /Jffs directory
I understand, if I reboot the router it should rebuild itself? I'm not seeing any output from within the GUI when logged into the router.
This is what I see by the way when I run syslog_move.sh
(syslog_move.sh): 21418 SYSLOG Housekeeping Running...... Tue Jan 24 21:47:42 GMT 2017 []
mv: can't rename '/tmp/mnt/sda1/Syslog/syslog.log': No such file or directory
cp: can't stat '/tmp/syslog.log': No such file or directory
(syslog_move.sh): 21418 Creating '/tmp/mnt/sda1/Syslog/syslog.log-20170124-214743-ZZ 'persistent BOOT log 1
rm: can't remove '/tmp/syslog.log': No such file or directory
(syslog_move.sh): 21418 Syslog moved to USB drive '/tmp/mnt/sda1/Syslog/syslog.log'
Syslog move OK. Script: syslog_move.sh
(syslog_move.sh): 21418 SYSLOG Housekeeping Complete...... Tue Jan 24 21:47:48 GMT 2017 for '/tmp/mnt/sda1/Syslog/syslog.log-20170124-214743'
(syslog_move.sh): 21418 SYSLOG Housekeeping scanning: /tmp/mnt/sda1/Syslog/syslog.log-20170124-214743-ZZ
syslog_move.sh: line 97: can't create /tmp/mnt/RT-AC68U-/Syslog/BOOT_Errors.txt: nonexistent directory
grep: /tmp/mnt/sda1/Syslog/syslog.log-20170124-214743-ZZ: No such file or directory
[: bad number
syslog_move.sh: line 105: can't create /tmp/mnt/RT-AC68U-/Syslog/BOOT_Errors.txt: nonexistent directory
(syslog_move.sh): 21418 SYSLOG Housekeeping custom script action scanning: '/tmp/mnt/RT-AC68U-/Syslog/MyCustomActions.txt'
syslog_move.sh: line 108: can't create /tmp/mnt/RT-AC68U-/Syslog/MyCustomActions.txt: nonexistent directory
Last edited: