Delete Syslog file from router via SSH ?

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


Joined: 20 Nov 2011
Posts: 194

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: 2029

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

_________________
Forum Guide Lines (with helpful pointers about how to research your router, where and what firmware to download, where and how to post and many other helpful tips!)
How to get help the right way

Before asking for help - Read the forum guidelines AND Upgrade DD-WRT!
Adblock by eibgrad + Blocklist Collection
James Greystone
DD-WRT User


Joined: 20 Nov 2011
Posts: 194

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: 1445
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.

_________________
2x Netgear XR500 and 3x Linksys WRT1900ACSv2 on 53544: VLANs, VAPs, NAS, station mode, OpenVPN client (AirVPN), wireguard server (AirVPN port forward) and clients (AzireVPN, AirVPN, private), 3 DNSCrypt providers via VPN.
James Greystone
DD-WRT User


Joined: 20 Nov 2011
Posts: 194

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 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