Batch-Batchrun

 view release on metacpan or  search on metacpan

lib/Batch/Batchrun/Retain.pm  view on Meta::CPAN

#=========================================================================
#=----------------->  R E T A I N _ F I L E  <---------------------------=
#=========================================================================
#  File: Retain.pm
#
#  Usage: Subroutine
#
#  Purpose: Copy and Compress files saving to backup directories
#
#   EXAMPLE - 
#  use Batch::Batchrun::Retain;
#
#  retain(FILE=>test, LIMIT=>5, DIR=>/apps/irmprod/archive,COMPRESS=>yes, 
#         DELETE=>NO};
#
#   FILE          - name of file to retain
#   LIMIT         - number of copies to keep (default 1)
#   DIR           - main directory to keep the copies

lib/Batch/Batchrun/Retain.pm  view on Meta::CPAN

  return(1);
  }
 
1;

__END__

=head1 NAME
 
 
Retain - keep backup copies of a file


=head1 SYNOPSIS


use Batch::Batchrun::Retain;

retain(FILE=>test,LIMIT=>5,DIR=>/apps/irmprod/archive,COMPRESS=>yes,DELETE=>NO);

=head1 DESCRIPTION

The C<retain> function provides a convenient way to keep backups of files. It keeps
a determined number of files in numbered directories. Arguments are passed using named
parameters.  Each name is case insensitive.  Of the several parameters only FILE and DIR 
are required. 

=head2 REQUIRED PARAMETERS

=over 4

=item B<FILE>

lib/Batch/Batchrun/Retain.pm  view on Meta::CPAN

                   bk2/

=back

=head2 OPTIONAL PARAMETERS

=over 4

=item B<COMPRESS>

compress the backup copies of the file. True values are indicated by 
passing 1 or yes. (unix only - defaults to no)

=item B<CHMOD>

the numeric mode to use when creating the backup file
(defaults to 0775)

=item B<DELETE>

deletes the original file if specified. True values are indicated by 
passing 1 or yes. (defaults to no)


=item B<LIMIT>

number of backup copies to keep.

=item B<PREFIX>

the prefix to use for each numbered directory.  The numbered directory will 
automatically be created if it does not exist. (defaults to bk)

=item B<VERBOSE>

show each file as it is moved or copied.
(defaults to off)



( run in 0.726 second using v1.01-cache-2.11-cpan-49f99fa48dc )