Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Preventing log file deletion

1 view
Skip to first unread message

catrefil

unread,
Oct 7, 2009, 10:05:37 AM10/7/09
to
Hi,

I'm trying to prevent log file from being deleted.
Would anybody already have implemented something like that? or have
any idea on how to do it?

Thanks

P.

Kari Uusimäki

unread,
Oct 7, 2009, 2:06:55 PM10/7/09
to

The information you told is very limited. Could you please describe your
problem more thorough so it would be better to understand what you want
to accomplish?

Which log do you mean? In which situation does it become deleted?


Kari


Bob Harris

unread,
Oct 7, 2009, 6:50:52 PM10/7/09
to
In article
<2b8a7669-aa3d-4df5...@31g2000vbf.googlegroups.com>
,
catrefil <plab...@gmail.com> wrote:

Create a hardlink to the file. As long as there is a directory
pointing at the file, it will not be deleted, on the other
directory entry.

ln file.log /some/other/directory/file.log

Notice there is NO -s in that 'ln' command. You want a hardlink,
not a symlink.

Of course if the file is not really deleted, but rather truncated
instead, that would be a different storey.

Bob Harris

catrefil

unread,
Oct 9, 2009, 9:32:11 AM10/9/09
to
On 7 oct, 18:50, Bob Harris <nospam.News....@remove.Smith-Harris.us>
wrote:
> In article
> <2b8a7669-aa3d-4df5-aad3-9d3d2a267...@31g2000vbf.googlegroups.com>
> ,

>
>  catrefil <plabro...@gmail.com> wrote:
> > Hi,
>
> > I'm trying to prevent log file from being deleted.
> > Would anybody already have implemented something like that? or have
> > any idea on how to do it?
>
> > Thanks
>
> > P.
>
> Create a hardlink to the file.  As long as there is a directory
> pointing at the file, it will not be deleted, on the other
> directory entry.
>
>     ln file.log /some/other/directory/file.log
>
> Notice there is NO -s in that 'ln' command.  You want a hardlink,
> not a symlink.
>
> Of course if the file is not really deleted, but rather truncated
> instead, that would be a different storey.
>
>                                     Bob Harris

That's a great idea Bob - I'm going to give it a try

Thanks

Philippe

catrefil

unread,
Oct 9, 2009, 9:42:11 AM10/9/09
to
On 7 oct, 14:06, Kari Uusimäki <uusim...@exdecWITHOUTTHISfinland.org>
wrote:

any log really but say /var/adm/messages
If somebody accidentally or intentionally deletes it. I'm trying to do
this as part of my hardening. The idead is If the log file cannot get
deleted then I'll always know what happened

0 new messages