[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: deleting symlinks

From: Tim Nelson
Subject: Re: deleting symlinks
Date: Tue, 16 Aug 2005 11:33:40 +1000 (EST)

On Tue, 15 Aug 2005, Klaus wrote:

This one seems to have come up before, but I couldn't find anything
that looked like a reasonable resolution. Some interesting posts,
though. ;-)

What is the proper way to remove a symlink with cfengine? I've got a
Linux distro that ships with '/usr/tmp' pointed at '/var/tmp' ... which
is actually more of a hindrance than a help.

I can't seem to simply overwrite the link itself with a directory - but
I can't find anything in the documentation that suggests what to do

Anyone out there care to offer the official solution, or any manner of
suitable workaround?

Just as background, I ran into a similar problem, where I wanted to replace a symlink with a directory tree with individual symlinks for all files, and then replace a few of the symlinks with symlinks to another tree.

Anyway, my solution was to use lots of ActionSequence stuff, some of my Perl Templating, and the following script, which I called "killlink".


if [ -L "$1" ]; then
         rm $1

My overall approach was:
# Custom action sequence:
# * Set Classes to decide whether to do this
# * Copy files (ignore this)
# * Kill modules link
# * Links (create one lot of new links)
# * Links (create the other lot of new links)

Kind Regards,
Tim Nelson
Server Administrator
P: 03 9934 0888
F: 03 9934 0899
E: address@hidden
WebAlive Technologies
Level 1, Innovation Building
Digital Harbour
1010 La Trobe Street
Docklands Melbourne VIC 3008

This email (including all attachments) is intended solely for the named 
addressee. It is confidential and may contain legally privileged information. If
you receive it in error, please let us know by reply email, delete it from your 
system and destroy any copies. This email is also subject to copyright. No
part of it should be reproduced, adapted or transmitted without the written 
consent of the copyright owner.

Emails may be interfered with, may contain computer viruses or other defects 
and may not be successfully replicated on other systems. We give no
warranties in relation to these matters. If you have any doubts about the 
authenticity of an email purportedly sent by us, please contact us immediately.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]