administering open files
00704a-Krakman
kmk at ihlpf.ATT.COM
Tue Nov 1 04:41:47 AEST 1988
I want to chop down the size of a file that is being written to by a
currently running process - actually one that is running out of /etc/inittab
and may never die. Here are some possibilities:
testprog > logfile &
1) mv logfile old.log
>logfile
This appears to work but I don't know how it could! When you create
the logfile in the second line it should have a different inode than
the one the testprog process knows about. So how can the testprog
write to the "correct" logfile?
2) To administer the /usr/lib/cron/log file, the UNIX System V Release 3 System
Administrator's guide says to put this entry in your cronfile:
tail -100 /usr/lib/cron/log > /tmp/log;mv /tmp/log /usr/lib/cron/log
If /etc/cron always has this log open (I'm assuming it does), than
won't it also be writing to the wrong file? It should have no way
of knowing the inode of the "new" /usr/lib/cron/log
Thanks ahead of time,
Ken Krakman
att!ihlpf!kmk
More information about the Comp.unix.questions
mailing list