Koozali.org: home of the SME Server

Legacy Forums => Experienced User Forum => Topic started by: gbentley on March 16, 2004, 05:00:36 PM

Title: Flexbackup Advice
Post by: gbentley on March 16, 2004, 05:00:36 PM
Hi All,

I am wanting to create my own customised flexbackup.conf and backup system. I have read though the howto and have a few questions to ask :-

1) If in flexbackup.conf I use :-

$filesystems[0] = '/data';

(I only want to include files in the directory /data)

do I need to specify '-fs all' on the CL or in a cron job ?

2) As a simple cron job to provide a 2am nightly backup and rewind I was going to create an executable file called backup containing :-

#!/bin/sh
# Tape backup job for flexbackup to do on cron schedule

/usr/bin/flexbackup -fs all (<- if needed ?)
/bin/mt -f "/dev/nst0" rewind

Then call that with this crontable entry :-

0 2 * * * root /usr/bin/backup


As a sanity check coulod anyone comment on any of the above - whether it would work ok or am I missing something important - Thanks in advance !
Title: Flexbackup Advice
Post by: gbentley on March 16, 2004, 05:14:34 PM
Forgot to include my commented flexbackup.conf - I have filled in comments from other config examples - I am not saying they are all right or that I understand all of them :)


--- Sample flexbackup.conf ---


# Parameters for 'afio' only - set 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';


# Block size (k) to use (default for most things is 10)

$blksize = '10';


# True 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

$mt_var_blksize = 'true';


# Buffering helps streaming the data from disc to tape

$buffer      = 'true';  # true to use "buffer" program
$buffer_megs = '3';     # buffer memory size (in megabytes)
$pad_blocks  = 'true';  # true to pad blocks to blocksize


# The type of compressor to use (make sure its installed)

$compress    = 'gzip';  
$compr_level = '4';    


# Parameters for 'cpio' only - format of cpio archive

$cpio_format = 'newc';


# The device to back up to [SCSI Tape 1]

$device    = '/dev/nst0';
$dump_length = '0';
$dump_use_dumpdates = 'false';



# Set this to "true" to make erase operations just rewind the tape - NOT call "mt erase"
# For some tape drives, erase takes hours rather than seconds The key thing is that mt
# cannot erase our tapes correctly , so you need this :-

$erase_rewind_only = 'true';


# If true (default), level zero "all" assumes you want to erase and use
# a new tape. If false, level zero "all" appends like all other backups

$erase_tape_all_level_zero = 'true';


# Other global flags

$remoteshell = 'ssh';   # command for remote shell (rsh/ssh/ssh2)
$verbose     = 'true';  # 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


# Log/stamp files, path for temporary 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


# File extensions that should not be compressed (seperate with spaces)
# For afio and zip only (since they do each file individually)
# Don't bother copmpressing these file types

$nocompress_types = 'gif zip jpeg jpg';


# Parameters for 'tar' only
# True to show record numbers

$tar_echo_record_num = 'false';

# True to preserve file access times
$tar_atime_preserve = 'true';



# Span across filesytems? ("dump" will ignore this option)
# Set to "false" (don't) , "local" (all but nfs), or "all" (everything)

$traverse_fs = 'false';


# List directories to be archived (i.e what it is you want backing up!)

$filesystems[0] = '/data';

$type = 'dump';
Title: Flexbackup Advice
Post by: gbentley on March 18, 2004, 10:08:25 PM
OK - well found out that this config file has some parameters for older versions of flexbackup ie < 1.1

To be honest its almost as easy to just edit the conf file the install rpm puts in place - nice to know what the paramters can do though.

One difference is that $filesystems[0] = '/data';

-fs isnt used any more.

I used flexbackup -dir /data_directory

Am going back tomo to see if the cron job / backup completed successfully.
Title: Flexbackup Advice
Post by: gbentley on March 19, 2004, 03:39:30 PM
|------------------------------------------------------------
| Doing level 0 backup of /data using afio
| ERROR: Tape doesn't have an index! (use -newtape?)
| Making sure tape is at end of data...
|------------------------------------------------------------
SCSI 2 tape drive:
File number=1, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x81 (DLT 15GB compressed).
Soft error count since last status=0
General status bits on (89010000):
 EOF EOD ONLINE IM_REP_EN
|------------------------------------------------------------
| Backup of: /data
| Date of this level 0 backup: Fri Mar 19 02:01:11 2004
| Date of last level 0 backup: the epoch
|------------------------------------------------------------
| printf "mp3 MP3 Z z gz gif zip ZIP lha jpeg jpg JPG taz tgz deb rpm bz2 \
|   lzo" > /tmp/nocompress.14990
| printf "Volume Label:\nlevel 0 /data Fri Mar 19 02:01:11 2004 afio+gzip \
|   from candle\n\n" > /tmp/label.14990
| cd "/data" && (printf "//--/tmp/label.14990 \
|   flexbackup.volume_header_info\n" && find . -depth -xdev ! -type s \
|   -print ) | afio -o -E /tmp/nocompress.14990 -z -1 m -P gzip -Q -4 -Z -M \
|   2m -T 3k -v -b 10k - | buffer -m 10m -p 75 -s 10k -t -u 100 -B -o \
|   "/dev/nst0"
| rm -f /tmp/nocompress.14990 /tmp/label.14990
|------------------------------------------------------------
CONTROL_FILE/flexbackup.volume_header_info -- okay
lost+found -- okay
Invoices/Invoice 3598 - Worksharp.doc.z -- (21%)

*** An incredibly long list of files with various compression percentages ***

Flyers & New Jobs -- okay

. -- okay
afio: 17479m+124k+0 bytes written in 7705 seconds. The operation was successful.
Kilobytes Out 17898620
|------------------------------------------------------------
| Backup start: Fri Mar 19 02:01:11 2004
| Backup end:   Fri Mar 19 04:09:40 2004
|------------------------------------------------------------
SCSI 2 tape drive:
File number=2, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x81 (DLT 15GB compressed).
Soft error count since last status=0
General status bits on (81010000):
 EOF ONLINE IM_REP_EN
|------------------------------------------------------------
| Rewinding...
| Removing old level 0 log of data (dated 200403181856)
|------------------------------------------------------------

Can anyone coment on this log ? Is the error at the top just down to using a new blank tape ?

Would you be happy that things are working ok ?
Title: Flexbackup Advice
Post by: gbentley on March 26, 2004, 05:22:42 PM
Backups worked ok. I preceded that job with a -newtape command which cleared up the error at the start.

For single file restores I used the file list method, something like :-

flexbackup -extract -flist /home/mylist.txt

mylist.txt cotains a list of the files / subdirs of the stuff you want restoring.

(you dont' need to add the root folder that you backed up ! - for example if you backed up /data
and data contained /files/myfile.txt then to restore
myfile.txt you only need to put files/myfile.txt
in the list - nothing happens if you add the root
of the backup directory or the slash)

However I have one question.

Is there any way to stop the job once the files I want have been restored ? I deliberatly picked a test file that was at the beggining of the tape which was restored within 5 miuntes but the drive kept on going right until the end of the tape which takes about 2 hours. Is there any way to stop that crazy thing ?