Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Thanks! Awesome group. I put out a simple question in the access/vba forum that I couldn't find answered on technet or anywhere else on the web and it was answered the same day!!..."

Geography

Where in the world do Tek-Tips members come from?
cpjust (Programmer)
12 Jan 10 17:07
Hi,
I can't figure out why this target isn't working.

CODE

    <target name="clear.oldcorefiles.nightly">
        <!-- Determine the earliest timestamp for removal as an offset from the
             current date and time -->
        <property name="clear.timestamp.pattern" value="MM/dd/yyyy" />
        <tstamp>
            <format
                property="oldcorefiles.timestamp"
                pattern="${clear.timestamp.pattern}"
                unit="day" offset="-14" />
        </tstamp>

        <!-- Delete old files -->
        <delete includeemptydirs="true">
            <fileset dir="/var/corefiles" includes="**/core.*">
                <date
                    datetime="${oldcorefiles.timestamp}" when="before"
                    pattern="${clear.timestamp.pattern}" checkdirs="true"
                />
            </fileset>
        </delete>
    </target>
It's giving this error, even though I've made all the core files owned by the user that the ant process is running as and I even made them 'chmod 777'...

CODE

/tmp/cleanup.xml:142: Unable to delete file /var/corefiles/core.15.days
    at org.apache.tools.ant.taskdefs.Delete.handle(Delete.java:624)
    at org.apache.tools.ant.taskdefs.Delete.execute(Delete.java:602)
    at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:357)
    at org.apache.tools.ant.Target.performTasks(Target.java:385)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
    at org.apache.tools.ant.Main.runBuild(Main.java:758)
    at org.apache.tools.ant.Main.startAnt(Main.java:217)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
cpjust (Programmer)
12 Jan 10 17:20
Doh!  Nevermind.
Even though the files were writable, it's the directory they're in that needs write permission to delete the files.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close