Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have some custom log files that are getting very big. (36 MB and 87 MB respectively). I have some other log files, that came with my distro, that are switched every week so they are the regular log file and a compressed backup. I think the squid log is one of those. example: cache.log, cache.log.1.gz to cache.log.5.gz
I believe this is done with a cron job. How do I make a cron job to compress and backup my custom log files every day?
My custom log files are:
Thanks for the reply. If you read the question, I need to know "HOW TO", not "what to".
In other words, I need a step by step guide to how to do what I am asking. What files I need to edit, what I need to type in, etc. That's why this question is in the newbie category, because I really don't know how to do it and never did it before.
I'm using Mandrake Multi Network Firewall with no GUI.
You might check out the man pages for logrotate. I'm not sure on your distro, but on fedora core there is a directory /etc/logrotate.d/ that contains all of the config files. For example the squid file looks like this:
[root@dbox logrotate.d]# cat squid
# This script asks squid to rotate its logs on its own.
# Restarting squid is a long process and it is not worth
# doing it just to rotate logs
/usr/sbin/squid -k rotate
Most of the details for the config files can be found in the man pages for "logrotate". If you use /etc/logrotate.d/squid it should already be included in a cron job. However as I said before this is dependant on your distro. But it sounded like you have log rotation going on and all you need to do is add these files to the process.
I just copied the same things that the squid logs have, since I basically want them to do the same thing. I did this last night and this morning the logs did not get backed up. Can you tell me what I did wrong?