Some programs don't like to have their log files yanked out from under them. Some will stop logging, and some will continue to log to the same file even if it moves instead of creating a new file. Usually restarting the service after moving a log file is a good idea (or stop, move file, then start).
All systems either have logrotate installed on them or available as an option. You might want to take a look at this - it provides a nice framework for backing up files on a date or size basis, compressing them, keeping X days worth, and also lets you do things before and after you back up the files (like stop or start a service).
Main Topics
Browse All Topics





by: _iskywalker_Posted on 2008-03-31 at 04:31:47ID: 21244474
well i recommend a bash script which is called by the cron:
Crontab
bash script:
#/bin/bash
mytmp="/tmp/"`date +'%d%m%Y'`
mkdir $mytmp
cp /LOGS/Bla/* $mytmp
crontab entry:
# min hour day Month Weekday User Befehl
15 22 * * * root /mydir/script.sh
from http://en.gentoo-wiki.com/