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 questions about logrotate and using it together with some custom scripts that i have added to the crontab.
As far as i have understood, its possible to add custom logs that will be managed by logrotate.
The scripts im using create their own directory structure
The path to where the logs are stored and the name of the log files themselves will change each month/day.
I have been searching for a way to pass variables to logrotate, making it understand the dates thats used by the script and make it look for them in the correct path.
Im thinking something down the lines of telling logrotate to rotate the file in:
From the man pages of logrotate i found the 'dateformat' and 'dateext' option, but as far as i can understand its not what im looking for here as its not only the name of the log files thats changing, but also the directories in which they are stored.
Is this even possible or will i have to change the scripts to be more logrotate "friendly"?
My apologies if this has been answered before, but i could not find anything that could solve it.
What you're telling us is the application or (r)syslog(-ng) rotates logs itself based on a "%Y/%B/%Y.%b.%d.*whatever.log" output template. So you don't need logrotate. If you want compression of "old" log files, for example of the previous month, you could achieve that with a simple script, a cron job, selecting your path based on a date setting like '/bin/date +"%Y/%B/" --date="1 month ago";' would output "2012/August/".