ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    logrotats vs simple cron job

    IT Discussion
    centos 7 logging
    4
    8
    938
    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.
    • IT-ADMINI
      IT-ADMIN
      last edited by

      Hi folks
      i work on a project of centralizing logs of all servers, and let's say i want to delete a very big log file daily at 00:00 night, what is the best way to do it : configure logrotate or create a simple cron job ??

      1 Reply Last reply Reply Quote 1
      • DustinB3403D
        DustinB3403
        last edited by

        Can your log aggregator not manage this for you? If not, logrotate is the modern approach, but crontab would work.

        IT-ADMINI 1 Reply Last reply Reply Quote 0
        • IT-ADMINI
          IT-ADMIN @DustinB3403
          last edited by IT-ADMIN

          @DustinB3403 said in logrotats vs simple cron job:

          Can your log aggregator not manage this for you?

          No, it is a manual setup,

          If not, logrotate is the modern approach, but crontab would work.

          i had trouble with logrotate therefor i decided to just create a simple cron job
          thanks

          IRJI 1 Reply Last reply Reply Quote 0
          • stacksofplatesS
            stacksofplates
            last edited by

            How are you getting the logs? Did you set up a syslog server or something?

            IT-ADMINI 1 Reply Last reply Reply Quote 0
            • IT-ADMINI
              IT-ADMIN @stacksofplates
              last edited by IT-ADMIN

              @stacksofplates said in logrotats vs simple cron job:

              How are you getting the logs? Did you set up a syslog server or something?

              yeah, ASA firewall send me logs to rsyslog on my box centos, rsyslog write these logs into a txt file, then logstash read from this text file and parse the data to elasticsearch for storage as a form of indexes,
              this mean that after each day i will not need this big text file so i have to delete it, so i'm asking how to do this safely
              by the way you like jesse pinkman 😉 yo yo

              stacksofplatesS 2 Replies Last reply Reply Quote 0
              • IRJI
                IRJ @IT-ADMIN
                last edited by

                @IT-ADMIN said in logrotats vs simple cron job:

                @DustinB3403 said in logrotats vs simple cron job:

                Can your log aggregator not manage this for you?

                No, it is a manual setup,

                If not, logrotate is the modern approach, but crontab would work.

                i had trouble with logrotate therefor i decided to just create a simple cron job
                thanks

                Logrotate runs using cron

                Check in cron.daily

                1 Reply Last reply Reply Quote 2
                • stacksofplatesS
                  stacksofplates @IT-ADMIN
                  last edited by

                  @IT-ADMIN said in logrotats vs simple cron job:

                  @stacksofplates said in logrotats vs simple cron job:

                  How are you getting the logs? Did you set up a syslog server or something?

                  yeah, ASA firewall send me logs to rsyslog on my box centos, rsyslog write these logs into a txt file, then logstash read from this text file and parse the data to elasticsearch for storage as a form of indexes,
                  this mean that after each day i will not need this big text file so i have to delete it, so i'm asking how to do this safely
                  by the way you like jesse pinkman 😉 yo yo

                  Ah, that was one thing that annoyed me about the Elastic Stack. Graylog lets you send rsyslog directly to it without needing the separate log parser.

                  1 Reply Last reply Reply Quote 0
                  • stacksofplatesS
                    stacksofplates @IT-ADMIN
                    last edited by

                    @IT-ADMIN said in logrotats vs simple cron job:

                    by the way you like jesse pinkman yo yo

                    Ha that's the first time I've heard that.

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post