• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

Linux logrotate

Hi!

i want to rotate daemon.log every week keeping last year's log... how i can do it?

Thanks in advance
0
morsa804tons
Asked:
morsa804tons
1 Solution
 
morsa804tonsAuthor Commented:
Hi!

i want to rotate daemon.log every week keeping last year's log... how i can do it?

Thanks in advance
0
 
ozoCommented:
crontab <<end
0 0 * * 0 mv daemon.log ratate.`date +%W`
end
0
 
TintinCommented:
Is daemon.log written to via syslog?

If so, add it to /etc/logrotate.d/syslog
0
 
Duncan RoeSoftware DeveloperCommented:
You can put the script in /etc/cron.weekly. That takes care of running it once a week.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now