NAME

CBAIS::Actions::Copy - copy a file


SYNOPSIS

$copy = new CBAIS::Actions::Copy(FILE => '/etc/passwd', MODE => '0644', OWNER => 'root', GROUP => 'root', );

if ($copy->execute()) { print ``copy /etc/passwd\n''; }

if ($copy->verify()) { print ``The file /etc/passwd is up to date\n''; }


DESCRIPTION

The CBAIS::Actions::Copy class implements a CBAIS action which copies files. The specified file is searched for in the CBAIS data tree. The details of the search are defined by the value of the ``CopyFileSpecifiers'' option in the CBAIS global config. See cbais_conf.

The verify and undo operations are aso supported. The undo operation may be disabled for certain files (useful for files like /etc/passwd).

The constructor recognises the following keys in addition to those defined by the CBAIS::Actions::MOGAction class.

FILE
The file to be copied. Note that the source file will be searched for according to the value of the ``CopyFileSpecifiers'' option in the CBAIS global config.

=item DONT_UNDO

Disable the undo (i.e.removal) operation for this file.


CONFIG FILE EXAMPLES

The following class file extracts show two example copy operations. The second example demosntrates a case where the undo opetation has been disabled.

{ action => 'copy', owner => 'mos', group => 'mos', mode => '0644', file => '/etc/ntp/ntp.conf', },


{
    action     => 'copy',
    owner      => 'mos',
    group      => 'mos',
    mode       => '0644',
    file       => '/etc/passwd',
    dont_undo  => 'yes',
},


SEE ALSO

the CBAIS::Actions::MOGAction manpage


L<CBAIS::Actions::Action>