What's new

Permanently moving traffic.db and syslog.log over to a USB Drive?

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

It seems that the parameters have changed
Possibly, (or you need to run dos2unix on the script) but use of scribe/syslog-ng is now the preferred method of moving Syslog to disk.
and/or I am not using the GNU versions of the logger and syslogd?
Code:
syslogd: invalid option -- 's'
BusyBox v1.31.1 () multi-call binary.
Just as a comparison, can you please check the version of syslogd?
Code:
syslogd --help

BusyBox v1.25.1 (2020-04-05 13:34:30 EDT) multi-call binary.
Usage: syslogd [OPTIONS]
System logging utility
(this version of syslogd ignores /etc/syslog.conf)
 -n  Run in foreground
 -R HOST[:PORT] Log to HOST:PORT (default PORT:514)
 -L  Log locally and via network (default is network only if -R)
 -O FILE  Log to FILE (default: /var/log/messages, stdout if -)
 -s SIZE  Max size (KB) before rotation (default:200KB, 0=off)
 -b N  N rotated logs to keep (default:1, max=99, 0=purge)
 -l N  Log only messages more urgent than prio N (1-8)
 -S  Smaller output
 -H NAME  Use NAME as hostname

Code:
which syslogd

/sbin/syslogd
 
Many thanks.. I am seeing:

Code:
# syslogd --help
BusyBox v1.31.1 () multi-call binary.

Usage: syslogd [OPTIONS]

System logging utility
(this version of syslogd ignores /etc/syslog.conf)

        -n              Run in foreground
        -O FILE         Log to FILE (default: /var/log/messages, stdout if -)
        -l N            Log only messages more urgent than prio N (1-8)
        -S              Smaller output
        -t              Strip client-generated timestamps

# which syslogd
/opt/sbin/syslogd

I installed the syslog-ng and the same version came from it..!

Oh I see -- there are two syslog's on my system..
There is one at /sbin/syslogd as well..
and that one has the options you mentioned..
so shall I rename/delete the /opt/sbin version?
 
Many thanks.. I am seeing:

Code:
# syslogd --help
BusyBox v1.31.1 () multi-call binary.

Usage: syslogd [OPTIONS]

System logging utility
(this version of syslogd ignores /etc/syslog.conf)

        -n              Run in foreground
        -O FILE         Log to FILE (default: /var/log/messages, stdout if -)
        -l N            Log only messages more urgent than prio N (1-8)
        -S              Smaller output
        -t              Strip client-generated timestamps

# which syslogd
/opt/sbin/syslogd

I installed the syslog-ng and the same version came from it..!

Oh I see -- there are two syslog's on my system..
There is one at /sbin/syslogd as well..
and that one has the options you mentioned..
so shall I rename/delete the /opt/sbin version?
If you wish to continue with the script, then you need to amend the script to explicitly call the non-Entware version '/sbin/syslogd'
 
If you wish to continue with the script, then you need to amend the script to explicitly call the non-Entware version '/sbin/syslogd'
Thank you very much.. will do that.
 
@Martineau
Thanks for this script, I use it long-standing but, at the moment, it needs an update :D

In the new firmware (384.19) the date and time log at startup has changed and the script is not working well.

I was able to manually change the date to line 144 of syslog-move.sh to identify the correct one but in MyCustomAction.txt and BOOT_errors.txt files I also find other messages that have nothing to do with it.

Additionally, a syslog.log-1 file is also kept in both the /jffs and /tmp folder and this file is added in the router's web interface system registry.

Is it possible to correct these errors without rewriting the entire script?

Thank you
 
@Martineau
Thanks for this script, I use it long-standing but, at the moment, it needs an update :D

In the new firmware (384.19) the date and time log at startup has changed and the script is not working well.

I was able to manually change the date to line 144 of syslog-move.sh to identify the correct one but in MyCustomAction.txt and BOOT_errors.txt files I also find other messages that have nothing to do with it.

Additionally, a syslog.log-1 file is also kept in both the /jffs and /tmp folder and this file is added in the router's web interface system registry.

Is it possible to correct these errors without rewriting the entire script?

Thank you
A lot has changed in the three and a half years since I first wrote the script!!!o_O

Yes the script can certainly be be tweaked, but most now use Entware utility syslog-ng to manage/move Syslog to USB. see here

e.g. either create custom syslog-ng filters to create the 'MyCustomAction.txt' and 'BOOT_errors.txt' files or simply clone/improve the scripts original 'grep' commands
Code:
grep -iE "ERR|FAIL|ABORT|INVALID|IGNOR|WARNING|out of memory" $SCANTHIS >> $ERRORFILE
to run a few minutes after the boot process has quiesced (either with a sleep delay in init-start or schedule a cron job) to scan the appropriate syslog-ng files.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top