Delete Syslog file from router via SSH ?

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> General Questions
Author Message
James Greystone
DD-WRT User


Joined: 20 Nov 2011
Posts: 164

PostPosted: Sun Mar 28, 2021 15:25    Post subject: Delete Syslog file from router via SSH ? Reply with quote
How does one go about deleting the syslog file from router once you have ssh into the router ?

Want to start with a new log.

Can't find the commands for this.

Thanks
Sponsor
bushant
DD-WRT Guru


Joined: 18 Nov 2015
Posts: 1567
Location: WCentral Indiana USA

PostPosted: Sun Mar 28, 2021 15:53    Post subject: Reply with quote
I do not know how to delete but you can start a "running" dump of the syslog.
tail -fn40 /var/log/messages

Or see only last x number of messages
tail -n40 /var/log/messages

_________________
STUBBY DoT install guide----Forum Guide Lines (Please read!) --- How to get help the right way----PIA Setup Guide by egc----
James Greystone
DD-WRT User


Joined: 20 Nov 2011
Posts: 164

PostPosted: Sun Mar 28, 2021 16:33    Post subject: Reply with quote
bushant wrote:
I do not know how to delete but you can start a "running" dump of the syslog.
tail -fn40 /var/log/messages

Or see only last x number of messages
tail -n40 /var/log/messages


Thank You..

I am not even sure if it is possible to erase it but I figure since it is just a text file it may be possible. Can't find anything in a web search so I may be wrong.
SurprisedItWorks
DD-WRT Guru


Joined: 04 Aug 2018
Posts: 1142
Location: Appalachian mountains, USA

PostPosted: Sun Mar 28, 2021 17:22    Post subject: Reply with quote
Try the command
Code:
: >/var/log/messages
from the CLI. No guarantees, as I haven't tried it. And that's a space (one or more of them) after the colon.

This is a linux thing, not a dd-wrt thing. The colon as a command makes the file exist (if it doesn't already) and be empty.

_________________
Five WRT1900ACSv2's on 42926, 44048, 46069: VLANs, VAPs, NAS, client mode, OpenVPN client (AirVPN), DDNS, wireguard servers and clients (AzireVPN), two DNSCrypt DNS providers (incl Quad9) via OpenVPN/wireguard clients.
James Greystone
DD-WRT User


Joined: 20 Nov 2011
Posts: 164

PostPosted: Sun Mar 28, 2021 17:27    Post subject: Reply with quote
SurprisedItWorks wrote:
Try the command
Code:
: >/var/log/messages
from the CLI. No guarantees, as I haven't tried it. And that's a space (one or more of them) after the colon.

This is a linux thing, not a dd-wrt thing. The colon as a command makes the file exist (if it doesn't already) and be empty.


It worked.

Thank You so much... appreciation
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum 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