[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Condor-users] Truncate, rotate or archive history file?




One of my friends advise me this:

Create a file, say  condorhistory in /etc/logrotate.d/

containing

/path/to/condor/spool/history {
    weekly
    rotate 52
    compress
    notifempty
    missingok
    copytruncate
    olddir /home/condor/spool/history/rotated
}

If you want to force a rotation now rather than waiting 1 week.

Run: /etc/cron.daily/logrotate

and then edit: /var/lib/logrotate.status

and change the date for this file to say the year 2004

Then run: /etc/cron.daily/logrotate

again or just wait one week. Hope that helps.

Santanu


On 1 Feb 2006, at 18:10, Daniel Forrest wrote:

Chris,

Our HISTORY files on each of our Condor nodes is getting large. Is
there some way to safely truncate and archive this file without
shutting down a daemon, or configure it to be done automatically?

You can just "mv" it to a new name, a new file will be created.

What I do is keep a hard link to "history" named "history.YYYYMM".
At the start of the month I can simply delete "history".  In this case
I also create a new "history" myself so I can make a new hard link.

I do this automatically with a cron job:

0 0 1 * * cd /exports/condor/spool && rm history && touch history && ln history $(date +history.\%Y\%m)

--
Daniel K. Forrest	Laboratory for Molecular and
forrest@xxxxxxxxxxxxx	Computational Genomics
(608) 262 - 9479	University of Wisconsin, Madison
_______________________________________________
Condor-users mailing list
Condor-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/condor-users