Retain - keep backup copies of a file
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.
the name of the file to retain
the name of the main directory. This is the directory where the numbered subdirectories will be created.
EXAMPLE: archive/ bk1/ bk2/
compress the backup copies of the file. True values are indicated by passing 1 or yes. (unix only - defaults to no)
the numeric mode to use when creating the backup file (defaults to 0775)
deletes the original file if specified. True values are indicated by passing 1 or yes. (defaults to no)
number of backup copies to keep.
the prefix to use for each numbered directory. The numbered directory will automatically be created if it does not exist. (defaults to bk)
show each file as it is moved or copied. (defaults to off)
retain returns 1 or 0 to determine completion status.
Current $VERSION is 1.03.