NAME

CBAIS::Actions::Symlink - create symbolic links


SYNOPSIS

$symlink = new CBAIS::Actions::Symlink(TARGET => '/etc/hosts', LINK=> '/etc/inet/hosts');

if ($symlink->execute()) { print ``symlinked /etc/inet/hosts -> /etc/hosts\n''; }

if ($symlink->undo()) { print ``removed symlink /etc/inet/hosts\n''; }


DESCRIPTION

The CBAIS::Actions::Symlink class implements a CBAIS action which creates symbolic links. The verify and undo operations are also supported.

The constructor recognises the following keys

TARGET
The target file (or directory) to link to. Must exists. May be a relative value (if dir is specified).

LINK
The name of the symbolic link. May be absolute or relative to current directory if DIR key is specified.

DIR
A directory to cd to before creating the symbolic link.


CONFIG FILE EXAMPLES

The following demonstrates a relative and absolute symlink configuration in a class file.

{ action => 'symlink', target => '/etc/ntp/ntp.conf', link => '/etc/ntp/ntp.symlink',


},

{ action => 'symlink', target => '../hosts', link => 'passwd.symlink', dir => '/etc/ntp',

},


SEE ALSO

the CBAIS::Actions::Action manpage