|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
crontab log removal
hello,
i know that this is not the correct forum, but i am not sure where to put a crontab question, so i came here. my question is probably very easy for those of you that use crontabs: i want to remove my logs once a day, i found this in a tutorial: 45 23 * * * /usr/local/bin/vnukelog but i am not sure if this is a standard way of doing this, or if i have to edit it to fit into my server, and if so, what should i be putting where? thanks for any help.. |
|
#2
|
|||
|
|||
|
>> my question is probably very easy for those of you that use crontabs
The syntax of your crontab is correct (Running a daily job at 23:45PM). In fact, your question really has nothing to do with crontab. >> i want to remove my logs once a day Why you wanted to remove it? You should rotate it instead. man 8 newsyslog. If you are worrying about those already rotated logs like messages.0.gz, you can run a cron to recombine and remove it. Like writing a script that will zcat the content of messages0.gz and place it to another file like /var/private/messages/messages_log, then delete the messages.0.gz on exit. Yes, your /var/private/messags/messages_log may accumulate to be very large file. What I would do is to run another cron to post-process this message_log and remove unwanted entries and preformat it and insert into a database. Anyhow, read up the manpage of newsyslog, maybe that's what you really wanted to do. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > crontab log removal |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|