logrotats vs simple cron job
-
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 ?? -
Can your log aggregator not manage this for you? If not, logrotate is the modern approach, but crontab would work.
-
@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 -
How are you getting the logs? Did you set up a syslog server or something?
-
@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 -
@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
thanksLogrotate runs using cron
Check in cron.daily
-
@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 yoAh, 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.
-
@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.