• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Clearing log file from the command line. [SOLVED]

Scheduled Pinned Locked Moved General pfSense Questions
4 Posts 3 Posters 3.1k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    ShMw
    last edited by Apr 10, 2018, 9:03 AM Feb 21, 2018, 9:44 AM

    Hi,

    After some searching, I haven't found a solution to clearing a log file and re-initializing it from the command line.  I've tried the usual favorites like:

    /var/log/log_file.log

    Indeed, this clears the file as expected however new logs are no longer written. The permission look the same, so I'm not certain what I'm missing. Ultimately I have to log in to the GUI and clear the clog manually, but it would be great if I could avoid this.

    Any insight is appreciated, and thanks…

    1 Reply Last reply Reply Quote 0
    • S
      somsrina9
      last edited by Feb 21, 2018, 9:58 AM

      I would like to do a lot to tell me what I need to do.

      1 Reply Last reply Reply Quote 0
      • J
        jimp Rebel Alliance Developer Netgate
        last edited by Feb 21, 2018, 1:58 PM

        The log files are binary circular logs, not plain text logs. If you truncate or otherwise alter the log files with utilities other than the GUI or the clog command, they will no longer be valid files that syslog will write.

        To reinitialize a log file at the default size, use this command:

        clog -i -s 511488 /var/log/name.log
        

        Replace name with the name of the log file to clear.

        Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

        Need help fast? Netgate Global Support!

        Do not Chat/PM for help!

        1 Reply Last reply Reply Quote 0
        • S
          ShMw
          last edited by Apr 10, 2018, 9:03 AM

          Thanks jimp, much appreciated!

          ;D

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
            This community forum collects and processes your personal information.
            consent.not_received