How to leave open files not to be deleted

30 views
Skip to first unread message

Senthivelrajan Lakshmanan

unread,
Dec 20, 2012, 8:58:22 PM12/20/12
to skulker2...@googlegroups.com
Hi Team,

I am trying to configure this excellent tool, one of the question I have is in the delete rule I would like to add option not to touch the file if the file is open.
Would you please advise how to do that.

Is the argument handleopen will do?

 <rule
                n="1000"
                type="delete handleopen"
                match_pattern="/.../^core$"
                match_by="MTIME OLDER_THAN 4D AND SIZE > 100k"

Thanks
Senthi


Simon Edwards

unread,
Dec 21, 2012, 8:01:53 AM12/21/12
to skulker2...@googlegroups.com
Hi,
  Probably still classed as an experimental feature! Which OS is this for?

  Also unlikely a core file will be open for use once it has been created/written?
Regards,
Simon.





--
You received this message because you are subscribed to the Google Groups "skulker2-discuss" group.
To view this discussion on the web, visit https://groups.google.com/d/msg/skulker2-discuss/-/SIlre0ulSV4J.
To post to this group, send an email to skulker2...@googlegroups.com.
To unsubscribe from this group, send email to skulker2-discu...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/skulker2-discuss?hl=en-GB.

Senthivelrajan Lakshmanan

unread,
Dec 21, 2012, 5:11:39 PM12/21/12
to skulker2...@googlegroups.com
Hi Simon and Team,

The original skulker removes the file only if no process has it currently open.

This is for AIX OS.

I have placed core as an example which may not be valid, since I am trying to move from current skulker to skulker2, want to make sure we keep the same functionality.

Please advise.

3466skulker
#!/usr/bin/bsh
# @(#)28 1.31 src/bos/usr/sbin/skulker/skulker.sh, cmdcntl, bos42G, g9713A 3/20/97 16:25:42
#
# COMPONENT_NAME: (CMDCNTL) system control commands
#
# FUNCTIONS:
#
# ORIGINS: 27
#
# (C) COPYRIGHT International Business Machines Corp. 1989, 1996
# All Rights Reserved
# Licensed Materials - Property of IBM
#
# US Government Users Restricted Rights - Use, duplication or
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
#
# Remove the file only if no process has it currently open
# WARNING: THE WHOLE PURPOSE OF THIS SCRIPT IS TO REMOVE FILES,
# SO IT HAS THE POTENTIAL FOR UNEXPECTED RESULTS.
remove_file()
{
if · -z ² /usr/sbin/fuser $1 2>/dev/null²  `; then
/usr/bin/rm -f $1
fi

Simon Edwards

unread,
Jan 3, 2013, 8:14:44 PM1/3/13
to skulker2...@googlegroups.com
Hi,
 Apologies for the delay in replying. Late evening here in the UK now, but tomorrow I will provide a small update that implements this requirement.

Regards,
Simon.


To view this discussion on the web, visit https://groups.google.com/d/msg/skulker2-discuss/-/YOkdI_GkbyMJ.
Reply all
Reply to author
Forward
0 new messages