initial commit of file from CVS for e-smith-flexbackup on Wed 12 Jul 08:54:20 BST 2023

This commit is contained in:
Brian Read
2023-07-12 08:54:20 +01:00
parent 774ef452c7
commit 4a4231dda8
41 changed files with 1615 additions and 2 deletions

View File

@@ -0,0 +1,15 @@
{
# ----------------------------------------------------------------------
# Parameters for 'afio' only
# True to show block numbers}
$afio_echo_block = 'false';
{
# Files less than this size (kilobytes) won't be compressed}
$afio_compress_threshold = '3';
{
# Maximum amount of memory (megabytes) to use for temporary storage of
# compression results. If a compressed file is bigger than this, compression
# will have to run twice on the file (see manpage).}
$afio_compress_cache_size = '2';

View File

@@ -0,0 +1,13 @@
{
# Block size (k) to use (default for most things is 10)
# mt_var_blksize says to use "variable" block size for the tape device
# (mt setblk 0)
# If false, will use the $blksize parameter above. All non-mt commands
# will still use $blksize regardless of this value.
my $blksize = $flexbackup{Blocksize} || '32';
$OUT = '$blksize = "' . $blksize . '";';
$OUT .= "\n";
my $mt_blksize = $flexbackup{TapeBlocksize} || '0';
$OUT .= '$mt_blksize = "' . $mt_blksize . '";';
}

View File

@@ -0,0 +1,5 @@
{# Buffering}
$buffer = '{ $flexbackup{BufferProg} || 'buffer' }'; {# name of buffer program to help streaming}
$buffer_megs = '{ $flexbackup{BufferMegs} || '20' }'; {# buffer memory size (in megabytes)}
$pad_blocks = 'true'; {# true to pad blocks to blocksize}

View File

@@ -0,0 +1,4 @@
{# Compression}
$compress = 'gzip'; {# one of false/gzip/bzip2/compress/hardware}
$compr_level = '4'; {# compression level (1-9) (for gzip/bzip2/zip)}

View File

@@ -0,0 +1,6 @@
{# ----------------------------------------------------------------------
# Parameters for 'cpio' only
# Format of cpio archive}
$cpio_format = 'newc';

View File

@@ -0,0 +1,11 @@
{# Device to backup to - non-rewinding version please!
#
# Examples:
# Linux SCSI: /dev/nst0 Linux IDE: /dev/nht0
# Linux ftape: /dev/nqft0 FreeBSD SCSI: /dev/nrsa0
#
# If a directory, archive to files in that directory rather than a device
#
my $device = $backup{'Device'} || '/dev/nst0';
$OUT .= "\$device = '$device';";
}

View File

@@ -0,0 +1,11 @@
{# ----------------------------------------------------------------------
# Parameters for 'dump' only
# Estimated tape size (in kilobytes). This number doesn't really do much
# but help 'dump' get size estimates if set to zero uses 'dump -a'}
$dump_length = '0';
{
# True to use /etc/dumpdates (could mess things up if you dump subdirectories
# of mount points). False to use flexbackup's timestamps.}
$dump_use_dumpdates = 'false';

View File

@@ -0,0 +1,6 @@
# Set this to "true" to make erase operations just rewind - not really
# call "mt erase". For some tape drives, erase takes hours rather
# than seconds.
$erase_rewind_only = '{
$flexbackup{erase_rewind_only} || 'false'
}';

View File

@@ -0,0 +1,4 @@
{# If true (default), level zero "set" assumes you want to erase and use
# a new tape. If false, level zero "set" appends like all other backups}
$erase_tape_set_level_zero = 'true';

View File

@@ -0,0 +1,8 @@
{# Exclude files that match these *regular expressions* (not shell wildcards)
# from the backups (no affect on 'dump' archives). You can list more than one,
# just keep incrementing the index in the brackets for each. Also, strip off
# leading directories (the filesystem specs above or the "-fs" flag).
# Comment these out to exclude nothing.}
$exclude_expr[0] = 'news/articles';
$exclude_expr[1] = '.*~$'; {#'# single quote so emacs font-lock is happy}
$exclude_expr[2] = './aquota.*';

View File

@@ -0,0 +1,9 @@
{# Other global flags}
$remoteshell = 'ssh'; {# command for remote shell (rsh/ssh/ssh2)}
$remoteuser = ''; {# secondary user name for remote shells (not set) }
$label = 'true'; {# store identifying label in archive }
$verbose = 'false'; {# echo each file? (for afio/tar/cpio/zip)}
$sparse = 'true'; {# handle sparse files (for afio/tar/cpio)}
$indexes = 'true'; {# false to turn off all table-of-contents support}
$atime_preserve = 'true'; {# preserve access time (if possible) during backup }
$staticfiles = 'false'; {# Use non-dated filename if backing up to file }

View File

@@ -0,0 +1,16 @@
{# ----------------------------------------------------------------------
# Log/stamp files, path for temporary files
}
$staticlogs = "false"; {# use dated log files}
$logdir = "/var/log/flexbackup"; {# directory for log files}
$stampdir = "/var/state/flexbackup"; {# directory for backup timestamps}
$index = "$stampdir/index"; {# DB filename for tape indexes}
$comp_log = "gzip"; {# compress log? false/gzip/bzip2/compress}
$prefix = ""; {# log files will start with this prefix}
$sprefix = ""; {# stamp files will start with this prefix}
$tmpdir = "/tmp"; {# used for temporary refdate files, etc}
{
# Why do I suggest /var/state/flexbackup for the stamp/indexes?
# See the FHS, http://www.pathname.com/fhs/2.0/fhs-5.11.html
# BSD users probably want /var/db/flexbackup
}

View File

@@ -0,0 +1,5 @@
{
$OUT =<<'HERE';
$mt{'tell'} = 'status';
HERE
}

View File

@@ -0,0 +1,4 @@
{# File extensions that should not be compressed (seperate with spaces)
# For afio and zip only (since they do each file individually)}
$nocompress_types = 'mp3 Z z gz gif zip lha jpeg jpg taz tgz deb rpm bz2';

View File

@@ -0,0 +1,9 @@
{# ----------------------------------------------------------------------
# Parameters for 'tar' only
# True to show record numbers}
$tar_echo_record_num = 'false';
{
# True to preserve file access times}
$tar_atime_preserve = 'true';

View File

@@ -0,0 +1,4 @@
{# Span across filesytems? ("dump" will ignore this option)
# Set to "false" (don't) , "local" (all but nfs), or "all" (everything)}
$traverse_fs = 'false';

View File

@@ -0,0 +1,4 @@
{# ----------------------------------------------------------------------
# Parameters for 'zip' only
}

View File

@@ -0,0 +1,31 @@
{
# List the filesystems you wish to dump when 'all' is given
# Just a simple space-separated list
# Remote filesystems should denoted as 'host:dir'
#
# Example:
# $filesystems[0] = '/ /usr /home machine1:/usr machine2:/home';
#
# If you want an 'all' level 0 backup to span multiple tapes, add more lines
# You will be prompted for tape change in between.
#
my @filesys = ();
my $outstring;
open(FSTAB, "</etc/fstab") or die "Can't open fstab file";
while (<FSTAB>)
{
/\S+\s+(\S+)\s+(\S+)\s+(\S+)/ &&
($2 eq "ext2" or $2 eq "ext3" or $2 eq "ext4" or $2 eq "xfs") &&
$3 !~ /(?:noauto|loop)/ &&
$1 !~ /^\/var\/spool\/squid/ &&
$1 !~ /^\/boot$/ &&
push @filesys, $1;
}
close FSTAB;
$outstring = "\$set{'full'} = '";
$outstring .= join(' ', @filesys);
$outstring .= "';";
$outstring;
}

View File

@@ -0,0 +1,10 @@
{
my @prunelist = split(',', $flexbackup{Prune} || '');
return "" unless (scalar @prunelist);
$OUT = '$prune';
$OUT .= "{'/'} = '";
$OUT .= join(' ', @prunelist);
$OUT .= "';";
}

View File

@@ -0,0 +1,4 @@
$type = '{# Archive type? afio, dump, tar, cpio, or zip
my $type = $flexbackup{Type} || 'tar';
$OUT = "$type";
}';