System Log on USB

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
AndyOxon
DD-WRT User


Joined: 16 Aug 2021
Posts: 81
Location: Oxford, UK.

PostPosted: Sat Feb 12, 2022 16:16    Post subject: Reply with quote
I’d write: ‘USB sticks not recommended for saving logs due to wear. USB HDD is preferred for this reason!’ I am sure I’ve read this somewhere already. I wouldn’t even mention jffs since it doesn’t seem appropriate here.
_________________
Hardware (Device/Firmware/Roles):
Netgear RAX50 | Stock | Gateway, DHCP, AP, NAS.
Netgear WNDR4500v2 | FreshTomato | Router, WAP (2G), WDS-AP (5G), Samba, Torrent Client.
Netgear WNDR4500v2 | FreshTomato | Router, WAP (2G), WDS-AP (5G).
Sponsor
oliver44
DD-WRT Guru


Joined: 01 Jun 2016
Posts: 504

PostPosted: Sat Feb 12, 2022 17:21    Post subject: Reply with quote
@ egc I modified with the new recommendation made by you ,it seems that now it displays the information correctly, but notice that via the web I no longer have the updated information


test2.PNG
 Description:
 Filesize:  2.64 MB
 Viewed:  1573 Time(s)

test2.PNG



ddwrt.PNG
 Description:
 Filesize:  409.24 KB
 Viewed:  1593 Time(s)

ddwrt.PNG



_________________
Internet provider https://en.wikipedia.org/wiki/RCS_%26_RDS 1Gbps
WDR3600 rev.1.5 - DD-Wrt
Linksys WRT1900ACS v.2 DD-Wrt/-OpenWrt



https://ipv6.chappell-family.com/ipv6tcptest/
https://en.internet.nl/connection/e91f490fe1c54cb2b78145c0ab0d2b5a/results
http://www.dnssec-or-not.com/
https://dnscheck.tools/#results


Last edited by oliver44 on Sat Feb 12, 2022 17:35; edited 1 time in total
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2971
Location: Germany

PostPosted: Sat Feb 12, 2022 17:34    Post subject: Reply with quote
oliver44 wrote:
@ egc I modified with the new recommendation made by you ,it seems that now it displays the information correctly, but notice that via the web I no longer have the updated information


# link /jffs/messages to /tmp/var/log/messages and make the logs readable in the WebIF

Code:
ln -sf /jffs/messages /tmp/var/log/messages
oliver44
DD-WRT Guru


Joined: 01 Jun 2016
Posts: 504

PostPosted: Sat Feb 12, 2022 17:39    Post subject: Reply with quote
@ho1Aetoo where do i put this code, do i need to change some code or do i need to add your code somewhere?

Code:
ln -sf /jffs/messages /tmp/var/log/messages

_________________
Internet provider https://en.wikipedia.org/wiki/RCS_%26_RDS 1Gbps
WDR3600 rev.1.5 - DD-Wrt
Linksys WRT1900ACS v.2 DD-Wrt/-OpenWrt



https://ipv6.chappell-family.com/ipv6tcptest/
https://en.internet.nl/connection/e91f490fe1c54cb2b78145c0ab0d2b5a/results
http://www.dnssec-or-not.com/
https://dnscheck.tools/#results
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2971
Location: Germany

PostPosted: Sat Feb 12, 2022 17:40    Post subject: Reply with quote
Quote:
killall syslogd
syslogd -Z -L -s 8192 -O /jffs/messages


>>>

Code:
killall syslogd
syslogd -Z -L -s 8192 -O /jffs/messages
ln -sf /jffs/messages /tmp/var/log/messages
oliver44
DD-WRT Guru


Joined: 01 Jun 2016
Posts: 504

PostPosted: Sat Feb 12, 2022 17:53    Post subject: Reply with quote
Everything seems to be working right, thanks again for all the help!


test2.PNG
 Description:
 Filesize:  721.65 KB
 Viewed:  1547 Time(s)

test2.PNG



_________________
Internet provider https://en.wikipedia.org/wiki/RCS_%26_RDS 1Gbps
WDR3600 rev.1.5 - DD-Wrt
Linksys WRT1900ACS v.2 DD-Wrt/-OpenWrt



https://ipv6.chappell-family.com/ipv6tcptest/
https://en.internet.nl/connection/e91f490fe1c54cb2b78145c0ab0d2b5a/results
http://www.dnssec-or-not.com/
https://dnscheck.tools/#results
oliver44
DD-WRT Guru


Joined: 01 Jun 2016
Posts: 504

PostPosted: Sat Feb 12, 2022 17:56    Post subject: Reply with quote
We could set a script to delete the information within a certain interval, every 7 days or 5 days, or even after a restart ?
I notice that he remembers all the logs since I let them on USB memory!

_________________
Internet provider https://en.wikipedia.org/wiki/RCS_%26_RDS 1Gbps
WDR3600 rev.1.5 - DD-Wrt
Linksys WRT1900ACS v.2 DD-Wrt/-OpenWrt



https://ipv6.chappell-family.com/ipv6tcptest/
https://en.internet.nl/connection/e91f490fe1c54cb2b78145c0ab0d2b5a/results
http://www.dnssec-or-not.com/
https://dnscheck.tools/#results


Last edited by oliver44 on Sat Feb 12, 2022 18:01; edited 1 time in total
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2971
Location: Germany

PostPosted: Sat Feb 12, 2022 18:00    Post subject: Reply with quote
Well you can delete the log via cronjob, I always delete my logs on sundays.

Code:
0 0 * * 0 root rm /jffs/messages


https://en.wikipedia.org/wiki/Cron
oliver44
DD-WRT Guru


Joined: 01 Jun 2016
Posts: 504

PostPosted: Sat Feb 12, 2022 18:05    Post subject: Reply with quote
in cron Jobs I still have a script from adblock, I can pass it under the first script ?

I'm sorry to ask so many questions, but I really don't know how these scripts work Embarassed

_________________
Internet provider https://en.wikipedia.org/wiki/RCS_%26_RDS 1Gbps
WDR3600 rev.1.5 - DD-Wrt
Linksys WRT1900ACS v.2 DD-Wrt/-OpenWrt



https://ipv6.chappell-family.com/ipv6tcptest/
https://en.internet.nl/connection/e91f490fe1c54cb2b78145c0ab0d2b5a/results
http://www.dnssec-or-not.com/
https://dnscheck.tools/#results


Last edited by oliver44 on Sat Feb 12, 2022 18:10; edited 1 time in total
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2971
Location: Germany

PostPosted: Sat Feb 12, 2022 18:07    Post subject: Reply with quote
without blank line it is certainly better
oliver44
DD-WRT Guru


Joined: 01 Jun 2016
Posts: 504

PostPosted: Sat Feb 12, 2022 18:10    Post subject: Reply with quote
I think that's what you meant


test3.PNG
 Description:
 Filesize:  8.99 KB
 Viewed:  1523 Time(s)

test3.PNG



_________________
Internet provider https://en.wikipedia.org/wiki/RCS_%26_RDS 1Gbps
WDR3600 rev.1.5 - DD-Wrt
Linksys WRT1900ACS v.2 DD-Wrt/-OpenWrt



https://ipv6.chappell-family.com/ipv6tcptest/
https://en.internet.nl/connection/e91f490fe1c54cb2b78145c0ab0d2b5a/results
http://www.dnssec-or-not.com/
https://dnscheck.tools/#results
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12881
Location: Netherlands

PostPosted: Sat Feb 12, 2022 18:21    Post subject: Reply with quote
-s sets the max file size in KB in the example 8 MB is used.

When it reaches max size it should rotate I assume, but have not tested it.
Perhaps test with a low value and see what will happen?

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2971
Location: Germany

PostPosted: Sat Feb 12, 2022 18:31    Post subject: Reply with quote
On the one SD card in one of my raspberrys I have already written 3TB of logs and the card is still alive.
If it dies then I just buy a new one for a few €.

Mr. Green
oliver44
DD-WRT Guru


Joined: 01 Jun 2016
Posts: 504

PostPosted: Sat Feb 12, 2022 18:32    Post subject: Reply with quote
egc wrote:
-s sets the max file size in KB in the example 8 MB is used.

When it reaches max size it should rotate I assume, but have not tested it.
Perhaps test with a low value and see what will happen?


give me an example and I'll test it

there is the possibility for me to manually edit / delete the log file via winscp, or not recommended ?



winscp.PNG
 Description:
 Filesize:  47.42 KB
 Viewed:  1486 Time(s)

winscp.PNG



_________________
Internet provider https://en.wikipedia.org/wiki/RCS_%26_RDS 1Gbps
WDR3600 rev.1.5 - DD-Wrt
Linksys WRT1900ACS v.2 DD-Wrt/-OpenWrt



https://ipv6.chappell-family.com/ipv6tcptest/
https://en.internet.nl/connection/e91f490fe1c54cb2b78145c0ab0d2b5a/results
http://www.dnssec-or-not.com/
https://dnscheck.tools/#results


Last edited by oliver44 on Sat Feb 12, 2022 18:38; edited 1 time in total
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2971
Location: Germany

PostPosted: Sat Feb 12, 2022 18:38    Post subject: Reply with quote
Quote:
syslogd --help
BusyBox v1.35.0 (2022-02-09 01:14:11 +07) multi-call binary.

Usage: syslogd [OPTIONS]

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

-n Run in foreground
-Z Adjust incoming UTC times to local time
-R HOST[:PORT] Log to HOST:PORT (default PORT:514)
-L Log locally and via network (default is network only if -R)
-C[size_kb] Log to shared mem buffer (use logread to read it)
-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-Cool
-S Smaller output
-t Strip client-generated timestamps


Quote:
killall syslogd
syslogd -Z -L -s 8192 -O /jffs/messages
ln -sf /jffs/messages /tmp/var/log/messages


default is 200KB

eg

Code:
killall syslogd
syslogd -Z -L -s 200 -O /jffs/messages
ln -sf /jffs/messages /tmp/var/log/messages


~4k = 1 page
Goto page Previous  1, 2, 3, 4, 5, 6  Next Display posts from previous:    Page 4 of 6
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum