What's new
  • 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!

RT-AC87R system log keeps showing old logs

jbodine74

Regular Contributor
I am running the latest Merlin build on my rt-ac87r. My system log keeps showing old logs starting on January 1 - December 31 (not sure what years) and no matter what I do, clear it, restart, factory reset, they come back. Is there a way to delete these old logs and start fresh?
 

Attachments

  • Screen Shot 2015-09-19 at 11.30.56 AM.png
    Screen Shot 2015-09-19 at 11.30.56 AM.png
    101.2 KB · Views: 584
That is normal. It is until the router gets an ntp time again.
 
I may be wrong, but syslog.log is stored in /jffs/ too, I have noticed this file being quite old and not updated sometimes, but removing it and rebooting router usually fixes this.

Use ssh or telnet to connect to your router to remove this file.
 
I know how to enable telnet but I have never messed around with jffs. Can you give me some code to type in to get to the jffs and delete the logs?
 
Change to directory /jffs
#cd /jffs

Make sure you are in the right directory
#pwd

List directory contents in a detail list
#ls -l

Delete syslog.log
#rm syslog.log
 
Awesome. So I logged in and went to delete the syslog.log and it works, but, the old logs are still there. In the jffs list there are files from 2014, configs and scripts. I am unable to delete those. See attached screenshot. Any ideas?
 

Attachments

  • Screen Shot 2015-09-19 at 4.02.13 PM.png
    Screen Shot 2015-09-19 at 4.02.13 PM.png
    12.4 KB · Views: 581
I would not recommend you to touch any of the other files and folders in jffs.

There is another syslog.log in /tmp too, but that is the one the running system uses.

There is however also a syslog.log-1 in /tmp and in /jffs, I believe this is a copy of syslog.log before a reboot.
As I see it, it is not strictly necessary to keep these files.


Maybe I should have started by asking why you don't like log files.. ;)
 
Asus code for saving logs onto jffs is buggy, it only copies if the new ones are bigger than the ones there - but it saves wearing out the flash chip!

see

https://github.com/RMerl/asuswrt-merlin/blob/master/release/src/router/rc/watchdog.c#L2083

Code:
if(tmp_log_stat.st_size > jffs_log_stat.st_size)
eval("cp", "/tmp/syslog.log", "/tmp/syslog.log-1", "/jffs");

Will work for first syslog file, but the tmp version is rotated to syslog.log-1 when it gets to 256kB, only a random chance of ever being slightly bigger when observed in future.

discussed here and elsewhere see for example
http://www.linksysinfo.org/index.ph...-write-syslog-and-traffic-data-to-jffs.71098/
 
Last edited:
Yeah, I was wondering why the latest log wasn't there, why it wasn't saved before each router reboot.

Thank's for the info!
 
I like seeing the logs. I just see these old ones and was wondering why they keep appearing. I'm not going to mess with this any more.. The router runs great and I'm not about to screw it up over some old logs. I really appreciate everyone's knowledge on this.
 
Asus code for saving logs onto jffs is buggy, it only copies if the new ones are bigger than the ones there - but it saves wearing out the flash chip! ... Will work for first syslog file, but the tmp version is rotated to syslog.log-1 when it gets to 256kB, only a random chance of ever being slightly bigger when observed in future.

Thank you @mstombs! That explains why the log stopped working, why clearing it didn't fix it, and why deleting syslog.log-1 did fix it.
 

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!
Back
Top