|
Sitback has 3 modes of operation..
The default is Backup. This is also the operation mode that has the most
available configuration options since it is the prime operation mode.
Most of the time, you will use sitback to backup..
Nobody wants to get to a point where Restore is needed, but sometimes,
we all get there.. That's life.. (so i hear!)
Both Backup and Restore is based on a script
located in <basedir>/etc/sitback. The script is a plain textfile containing keywords
that tells sitback what,how,when and where...
Most of what you put in the script can also be specified on the command-line,
only the target files/directory's must be defined in the script...
Before looking at the command-line options, let's go through the script content.
(The script directives are case-insensitive, archive=ARCHIVE, but some of the
configuration data, such as the archive name, is case-sensitive.)
- ARCHIVE
- This is the name of the file or device to where the archive should be written,
or files restored from.
- TARGET
- A target is a file or a directory that must be included in the archive.
You dont need any targets in the script to restore files from an archive,
but normally you would use the same script when you backup and restore...
Tar recurses directory's, so if you specify 'TARGET=/', you would get your
entire filesystem including any filesystems mounted somewhere in the path.
You may have as many targets as you like/need
- COMPRESSION
- Sitback does not by default compress the archive, sometimes it is ok to
compress a backup, f.ex. if you have 3-5 tapes that is updated each week.
But other times, the archive should remaine on the tape for several years
before someone needs a file from the archive. Those archives should not
be compressed, because a single error early on the tape would make the rest
of the tape garbage.. More sophisticated backup programs might compress
each file before writing it to the tape, but again, a single missing byte
might render a large file unuseable..
'COMPRESSION=YES' enables compression
'COMPRESSION=NO' disables compression (default setting), but you may override
it from the command-line.
Sitback will use the best available compression method. If you have bzip2 on the
system, this is the 1. choice. If bzip2 is not available, Sitback looks for
gzip, and if gzip is not available, Sitback looks for compress.
Compress is not very good for this task, but better than nothing.. But i recommend
that you get bzip2 if you plan to use compression.. By the way, bzip2 uses a large
amount of memory, and may consume a lot of your cpu time, but you also gets a
very good compression rate..
Dont worry if Sitback takes twice as long time with bzip2 than with gzip, even on
fast machines with lots of ram.
- COMPRESSOR
- Instead of Sitback choosing the best available compression tool, you can
select a tool that is to be used (if available).. Use this directive if
you f.ex. wants to use gzip, althoug bzip2 is available on your
system.. This could be for improved speed, or to maintain compatibility with
systems without bzip2..
- VERIFY
- 'VERIFY=YES' will make sitback verify the archive after a backup,
'VERIFY=NO' will make sitback skip verification of the newly created
archive (hint..: This is a really bad idea....!)
You can not verify a compressed multiple volumes archive...
- REPORTFILE
- Gives the name of a file that gets a copy of the backup/restore report.
- REPORTPRINTER
- Gives the name of the printer that should be used to print the backup/restore report.
If the name begins with '//' or '\\\\' sitback assumes that it is a smb printer.
Sitback needs Samba to be able to
print on a smb printer..
Else, sitback uses 'lpr' with the '-P' switch set to the given name...
- SMBUSER
- If you use a smb printer as 'REPORTPRINTER', you may have to specify a
username.
- SMBPASSWORD
- If you use a smb printer as 'REPORTPRINTER', you may have to specify a
password. BE CAREFULL.. You will have an unencrypted password
in the script, this is one of the reasons it is good to let sitback
run as 'root', and then protect the scripts from any other user...
- VOLUMENAME
- States the name of the backup you are doing. It goes into the archive,
but it is mainly here to make it more easy for you to find your way
around many different archives.. should you ever need that...
Blank spaces is allowed in the volume name, 256 characters max.
- TIME
- Specify a time when the backup should run.. This also applies if you run from the command-line,
without the '-d' switch (called single mode), if your script has a 'TIME'
line, sitback will wait until that time before it runs..
This behaviour can be turned off with the '-s' switch.
The 'TIME'-string has the format..
day_of_week is a number in the range 0-6, 0 is sunday and 6 is satterday..
so the time, monday at 22:30 would give the 'TIME'-string
You can have as many 'TIME'-strings as you like. Should they overlap, one of
the backups would just not start until the previous one has finished.
- MULTIPLE
- 'MULTIPLE=YES' enables sitback to create multiple volumes if the first
device (f.ex. a tape) has no more space left..
You will be prompted for the next volume..
'MULTIPLE=NO' is the default setting.
Multiple volumes may also be requested from the command-line.
Multiple volumes is not allowed in scheduled backups.. (the daemon can not
ask anyone to change tape at 03.45 in the night!!)
- VOLUMELENGTH
- Almost the same as 'MULTIPLE', but now sitback will not make the archives
larger than 'VOLUMELENGTH' bytes.. You must specify either an equal number of 1024 bytes, or
##K or ##M wich represents respectively KiloBytes and MegaBytes.
As with MULTIPLE, this is not allowed when running as a daemon.
- RETRY
- Retry backup or restore if there is an error. Use this if your tapedrive is an older
model wich sometimes fails for no reason.
The retry count must be in the range [0;9] where 0 is no retry and 9 is
9 retry's, (1 initial run + 9 retry's).
RETRY=3 sets a retry count of 3.
Sitback takes various switches on the command-line. You
might f.ex. disable some features enabled in the script, or enable something,
disabled in the script, such as compression.
As always, by typing sitback --help you will get all the help you need
to find the right switch or syntax..
- Backup operation
- sitback [options] scriptname
- -a <archivename|devicename>
- Use this archive or device instead of
ARCHIVE from the script
- -c [BZIP2|GZIP|COMPRESS]
- Compress archive.
If you want to control wich compression tools
is used, give the tool-name here.
- -d
- Run as daemon instead of just a single run
- -e
- Dont verify the archive after backup.
- -i archive-id
- Set the archive id to this string. (no
blank spaces is allowed). The archive-id is
updated or added, if no current archive
exists, f.ex. on a tape, a archive is
created. In any case, operation is stopped
after updating the archive id so that the.
archive is empty apart from the info
- -m [count][K|M]
- Create multiple volumes.
If a byte-count is given, volumes will be
no larger than #count# bytes.
'K' or 'M' may be appended to indicate that
count is in KB or MB. When no modifier is
appended, the count should be an equal
number of 1024B blocks.
If no length is given, multiple volumes is
only created if the first device has no
more space on it.. The user will the be
prompted for a new tape/disk. Multiple
volumes is not allowed in daemon mode.
Verification of backup is not possible if
compression is used, the -e switch is
then silently appended.
- -n
- Ignore the time-string, run now.
- -s
- Dont try to resolve archive-info before
backup or update of archive-info.. This
may result in database inconsistency
such as incorrect content-list's or
archive-id's no longer existing. Use only
if you want to set archive-info such as a
new id on a blank tape.
- -t timestring
- Use this single time-string instead of TIME
from the script. The time-string has the
format... 'day of week number;hour;minute'
Day of week number is 0(sun) to 6(sat).
Ex. \"1,3,5;02;30\", mon, wed, fri, at 02.30.
- -u
- Update archive files that have changed, do not
recreate the archive from scratch.
- -y #count
- Retry operation if there is an error. This might be a good idea if you are using
an older buggy or dirty drive. Default is no retry (0), but retry may be
set to a number in the range [0;9]
-
-
- Restore operation
- sitback -r <scriptname>
Restore has not yet been implemented. But the archives is regular tar
archives, so you may use 'tar -x -P -f archivename|devicename to restore
the content of the archive.
-
-
- List operation
- sitback -l [scriptname]
List operation has not yet been implemented.
-
-
- Other operations
- sitback option [data]
- --help
- Show the help screen. (You might want
to do.. 'sitback --help | more')
- --version
- Show version.
Are you confused ? Great!..
Well... it is not that difficult as you might expect.. Go to the
download page, there is an example script.
showing how you would write a script for automated backup's..
To run sitback as a daemon, just type sitback -d data 'data' is
the name of the script, you may call it whatever you like..
To run the same script, but only one time, ignoring the time-string,type
sitback -n data
If you have a new tape or disk that should be given its archive id just ype
sitback -i foo_cooperation_tape_007 -a /dev/st0 This puts a default archive
on the tape (in this example it is the /dev/st0 device), so that when you use the tape for
automated backup's, it is included in the database with the archive-id
'foo_cooperation_tape_007'.
| |