to scdbackup homepage
scdbackup
- Examples -
to top of page
A sample configuration
I do recommend that a non privileged user performs installation
and configuration. Only very few actions of the installation procedure
actually need superuser authority. They are collected in the script
SUPERUSER_CONFIGURE which is executed in Step 3 below.
The user's actions are shown in bold typeface.
Step 1 of the installation procedure (see README) is
to unpack the archive in an arbitrary directory (here: /home/test) and to go
to the newly created directory scdbackup-0.7 :
-
- $ cp scdbackup-0.7.tar.gz /home/test
- $ cd /home/test
- $ tar xvzf scdbackup-0.7.tar.gz
- ... all the filenames of the archive ...
- $ cd scdbackup-0.7
Now (after having read README "Planning" and deciding what to put in the
system backup) i start the configuration script :
-
- $ ./CONFIGURE
If there is already an installed version of cdrecord in the command path, then an overview of the SCSCI devices is shown.
If not, the superuser can run ./cdrecord_prog -scanbus to get this overview (provided that this binary program is suitable for your system).
-
- scsibus0:
- 0) *
- 1) *
- 2) 'TOSHIBA ' 'CD-ROM XM-6201TA' '1037' Removable CD-ROM
- 3) 'YAMAHA ' 'CRW4260 ' '1.0j' Removable CD-ROM
- 4) *
- 5) *
- 6) 'TANDBERG' ' TDC 3800 ' '=04:' Removable Tape
- 7) *
Since i know that my CD recorder is a YAMAHA, i learn that its SCSI address is 3,0 (there is no subunit with this recorder).
-
- scdbackup installation script 0.7
- Note: Empty input leaves the current setting unchanged
- SCSI-Address of CD recorder ? (e.g. 3,0)
- current setting: ""
- 3,0
- Speed ? (e.g. 2)
- current setting: ""
- 4
- Note: erasing CDs is usable for rewritable CD-RW media only
- Automatically erase CD before writing ? (yj1/n0)
- current setting: ""
- N
- Note: recording CDs without buffering at higher speed may fail
- if the system is slow or its load by other processes is high
- System backups without buffering cannot be compressed.
- Buffer file name ? ( "-" = without buffering )
- current setting: ""
- /cdpuffer/isofs
- Note: your version of mkisofs must support the target notation
- /target=source. If not, you should use the programs
- mkisofs_prog and cdrecord_prog in this directory or compile
- cdrecord-1.6 and mkisofs-1.12b3
- (see README appendix COMP)
- Use mkisofs_prog and cdrecord_prog ? (yj1/n0)
- current setting: ""
- Y
- Note: if you enter 0 then the directory size is determined
- by a very slow method which previews the compressed
- afio sizes.
- Estimated capacity for a compressed afio CD ? (eg. 1024m)
- current setting: ""
- 1200m
- Exclusion list of directories for system backup ?
- current setting: "/cdrom /cdrw /floppy /home /mnt /opt /proc /tmp"
- /cdrom /cdrw /floppy /home /mnt /opt /proc /tmp /cdpuffer /n
(Please note that a single line is expected here, despite your browser right now may show more than one)
-
- Note: The locking protocol is advised for real multi user environments
- It reserves the result scripts and the CD recorder and prevents
- access to them by other parts of this program system.
- Apply locking protocol ? (yj1/n0)
- current setting: ""
- N
- Note: The install directory will be used by SUPERUSER_CONFIGURE.
- It has to contain the subdirectories bin and sbin.
- bin should be mentioned in the PATH variable of normal users.
- sbin should be in the PATH of the superuser.
- Install directory ?
- current setting: "/usr/local"
- /usr
The interogation ends now and the parameters get written to their files.
In future runs of CONFIGURE you may confirm your settings by empty input
lines and only have to enter those values which you want to change.
You also may write scripts which manipulate the files directly.
See README Appendix CONFIGURATION for a definition of the files' content (if it
isn't obvious by name and sequence :)
-
- writing file scdbackup_scsi_adr_value
- done
- writing file scdbackup_speed_value
- done
- writing file scdbackup_blanken_value
- done
- writing file scdbackup_buffer_value
- done
- writing file scdbackup_use_prog_value
- done
- writing file scdbackup_mkisofs_value
- done
- writing file scdbackup_cdrecord_value
- done
- writing file scdbackup_z_cap_value
- done
- writing file scdbackup_sys_excl_value
- done
- writing file scdbackup_t_lock_value
- done
- writing file scdbackup_bin_sbin_root_value
- done
- compiling program temp_lock.c
- done
- compiling program raedchen.c
- done
- compiling program cd_backup_planer.c
- done
- publishing directory address : /home/test/scdbackup-0.7 in /home/thomas/.scdbackup_dir
- done
- First stage of installation done.
- --------------------------------------------------------
- Do not forget to run ./SUPERUSER_CONFIGURE as superuser
- --------------------------------------------------------
Now, one could already use
/home/test/scdbackup-0.7/backup_example*
like scdbackup* but there is still the
problem that only the superuser may execute cdrecord_prog.
So, i perform Step 3 of the installation procedure.
-
- $ su
Password:
# ./SUPERUSER_CONFIGURE
This script enables usage of the CD recorder for all users
and installs following commands owned by the super user :
- scdbackup in /usr/bin access: a+rx,ug+w,o-w
- scdbackup_home in /usr/bin access: a+rx,ug+w,o-w
- scdbackup_afio in /usr/bin access: a+rx,ug+w,o-w
- scdbackup_sys in /usr/sbin access: ug+rwx,o-rwx
- scdbackup_clear in /usr/bin access: ug+rwx,o-rwx
Note: the install directory can be set with ./CONFIGURE
Do you want to enable access to the CD recorder ? (y/n)
Y
confirmed
Do you want to install the scripts below /usr/local ? (y/n)
Y
confirmed
To enable access to scdbackup for the superuser, i also execute ADD_USER.
-
- # ./ADD_USER
publishing directory address : /home/test/scdbackup-0.7 in /root/.scdbackup_dir
done
# exit
to top of page |
to scdbackup homepage
Backup run with scdbackup_home
The installation was performed in /home/test.
Locking protocol is not enabled (necessary only if more than one person is working with the machine concurrently).
The user's actions (1 command, 5 Enter keys) are shown in bold typeface
-
- $ scdbackup_home
The disk is rattling for about five minutes now.
My box is a K6/350 and below my HOME directory are about 3 GB.
From time to time one of these information lines appears:
-
- ... splitting .
- ... splitting ./p
- ... splitting ./p/sorten
- ########### 1 (9 items 670025728 bytes)
- ########### 2 (16 items 671067919 bytes)
- ########### 3 (10 items 671080448 bytes)
- ########### 4 (16 items 671072256 bytes)
- ... splitting ./.netscape
- ########### 5 (335 items 337185273 bytes)
- ########## part 1 of 5 (9 items 670025728 bytes)
- insert CD and press Enter
The distribution plan for five CDs is made and the result script took over control now.
This is the time to insert a CD-R and press the Enter key.
The following messages come from mkisofs and cdrecord:
-
- Total extents scheduled to be written = 326878
- 1.53% done, estimate finish Sat Nov 27 22:37:54 1999
- ...
- 99.43% done, estimate finish Sat Nov 27 22:28:10 1999
- ...
- 326878 extents written (638 Mb)
- Cdrecord release 1.6 Copyright (C) 1995-1998 Jörg Schilling
- ...
- /home/test/scdbackup-0.7/cdrecord_prog: fifo was 0 times empty and 20071 times full, min fill was 96%.
- Fixating time: 62.121s
The first CD is done, gets ejected and scdbackup asks for the next one:
-
- ########## part 2 of 5 (16 items 671067919 bytes)
- insert CD and press Enter
This is again the time to insert a CD-R and press the Enter key.
-
- ...
- ########## part 3 of 5 (10 items 671080448 bytes)
- insert CD and press Enter
Press Enter
-
- ...
- ########## part 4 of 5 (16 items 671072256 bytes)
- insert CD and press Enter
Press Enter
-
- ...
########## part 5 of 5 (335 items 337185273 bytes)
insert CD and press Enter
Press Enter
-
- $
It is done. Five CDs. Tightly packed. I watched two movies in TV meanwhile and changed CDs every half hour. (Speed factor 4)
to scdbackup homepage
to top of page
Resuming an interrupted backup run
After a backup run has been interrupted, it can be resumed without distributing
the data over the CDs again. This guarantees that the new CDs match the old
ones. Care should be taken that not too many new files have been created
meanwhile. Otherwise particular CDs might overflow.
If you expect an interupted backup then you should decrease the size of
the pieces in order to get more buffer space for subsequent size increases.
Use -max_size 600m to reserve 50 MB on each CD.
-
- $ scdbackup_home -resume
Let us assume that the run was interrupted during the forth piece:
-
- ...
- ########## part 4 (16 items 671072256 bytes)
- insert CD and press Enter
Press Enter
-
- ...
########## part 5 (335 items 337185273 bytes)
insert CD and press Enter
Press Enter
-
- $
It is done again. Two missing CDs have been created.
to top of page
Searching and restoring a particular file or directory
From time to time, i spoil some of my files. Linux is quite safe, i am not.
For example, i lost the file $HOME/gifs/milleniumbug.gif
But i have got my backup !
First i mount one of the CDs (it doesn't matter which one)
-
- $ mount /cdrom
Since i have got the "exec" option in the /cdrom line of /etc/fstab, i can execute the ASKME script directly from CD.
-
- $ /cdrom/ASKME gifs/milleniumbug.gif
- 5 gifs gifs/milleniumbug.gif
From this answer i learn that the whole directory "gifs" is on CD number 5.
Now i have to mount this CD and can restore my lost file.
-
- $ umount /cdrom
I insert CD number 5 and execute
-
- $ mount /cdrom
- $ cp /cdrom/gifs/milleniumbug.gif $HOME/gifs
and the milleniumbug (75 K GIF movie) is back on my disk.
For some more info about ASKME see ASKME -help
to top of page
Incremental backups
If you got a substantial amount of data, it becomes annoying to backup the old
data with each new run. To avoid this (within certain limitations) one may
use an incremental backup scheme.
For this purpose a backup configuration needs to be created. We simply
use the $HOME backup but one could also record an arbitrarily complicated
set of data sources and options. After the configuration is created, only
its name and the desired update level have to be given with the scdbackup
command.
-
- $ scdbackup_home \
      -conf_dir $HOME/home_backup \
      -level -create_configuration
This creates the directory $HOME/home_backup (and fails if it already exists)
and records the parameters of the backup (which are set within script
scdbackup_home). Also it starts the initial base backup which
is called -level 0. This backup is exactly like any other run
of scdbackup_home (see above).
The difference comes with the update run a few days later:
-
- $ scdbackup \
      -conf_dir $HOME/home_backup \
      -level 1
This command causes the backup configuration $HOME/home_backup to be read
and updated on level 1. Level 1 backups all files that were changed or are
new since the last run of level 0.
So from now on, you do base backups with -level 0. These base
backups include all files without any time constraint. Updates of the base
backups are done by -level 1 in regular intervals.
You may also do short term updates which refer to the last run of level 1
by running a -level 2 backup.
There is no upper limit of level numbers but you may only increase them by
one with each run. That is, after a level 0 run was done, you cannot do
a level 2 run but only level 1. The special level -next can be
used to get the highest permittable level.
A backup scheme which from monday to saturday records only the
daily changes and makes a full backup each sunday:
Monday : -conf_dir $HOME/home_backup -level -next
...
Saturday: -conf_dir $HOME/home_backup -level -next
Sunday : -conf_dir $HOME/home_backup -level 0
Now the media of monday to saturday may be recycled.
A scheme which makes quarterly (13 weeks) full backups, four-weekly
and weekly updates (-conf_dir same as above). This scheme lets you
retrieve old file versions for quite a long time.
Week 1 : -level 1
Week 2 : -level 2
Week 3 : -level 2
Week 4 : -level 2
Week 5 : -level 1
Week 6 : -level 2
Week 7 : -level 2
Week 8 : -level 2
Week 9 : -level 1
Week 10 : -level 2
Week 11 : -level 2
Week 12 : -level 2
Week 13 : -level 0
For week 14 hop to week 1.
It is advised to keep levels 0 and 1 for a longer time.
To combine both schemes shown, simply replace the sunday run of
scheme 1 by the weekly run of scheme 2.
If you want to change the configuration parameters, you may either run
the altered command with special level -update_configuration:
-
- $ scdbackup_home \
      -max_items 1000 \
      -not trashdir newsdir \
      -conf_dir $HOME/home_backup \
      -level -update_configuration
or you may directly edit the parameter list file
$HOME/home_backup/specific_arguments
In this file, each single argument is recorded in a single line. The list
begins with arguments automatically set by scdbackup and ends with arguments
given by you (if any).
Be aware what the options mean before you delete or change them. Also
perform a new -level 0 backup afterwards.
Incremental backups include the ASKME scripts of lower levels. If you use
the ASKME script of level 2 it will try to execute the ASKMEs of level 1
and level 0 if it cannot find a file by itself. The option -levelall
causes all levels to be searched in any case.
These features are not restricted to scdbackup_home but may also
be used with scdbackup and scdbackup_afio. One may
have an abritrary number of configurations in distinct directories.
Now for some restrictions:
-
Regrettably, mere name changes do not change the file's time stamps in
the general Linux filesystem model. So if you move a file within the same
file system, it will not be recognized as "changed".
-
Because of the restricted number of fileaddresses possible with mkisof
there may be whole directories included in the backup despite they contain
some older files.
to top of page
CD mount options
The /cdrom line in my /etc/fstab looks like this
-
- /dev/cdrom /cdrom iso9660 ro,user,noauto,unhide,exec
to top of page |
to scdbackup homepage