Save Precious Information For Future Access - A spiffing program!

A Linux backup and restore application
By David M. Balean

Email Me

This describes spiffa version 1.3 which adds the capability to restore a selection from a saved backup in addition to a few other improvements.

Brief Description
The purpose of spiffa is to back up and restore selected computer data locally to a directory either on a second internal disk drive or on an external disk drive such as a Maxtor external 300 G USB hard drive.  It is not designed to be used over a network or to backup directly to a device.  The drive must be fully accessible by root.  There are many programs available but I couldn't find exactly what I was looking for so here is spiffa.  It includes the following:-
This program prohibits backing up /proc, /sys and the directory that is the destination of the backup, any of which could lead to disaster.  It can back up to a directory on the the same drive as the data but this is probably inadvisable because if that disk fails the backup is probably not recoverable.  Some programs don't allow for unusual permissions or fail if filenames include unusual characters and spiffa has been designed with these problems in mind.

Some Screen Shots

Main window (normal user)

Main window (root user)

Main window (Backup using specified configuration)

How It Works
There are two programs, a backend (spiffaslave)  and the frontend (spiffa).  The backend, spiffaslave, has to be started by spiffa.  In order to run the GUI, the user "david" enters as follows at the command line:-

[david@octopus ~]$ spiffa

In order to change to the root user to get the full works:-

[david@octopus ~]$ su
Password:                         (enter root's password)

THEN issue the spiffa command as above.  The
$ is usually changed to # when the user has become root i.e. the superuser.

The slave runs suid and communicates with 
spiffa.  All the work is done by the slave, spiffa merely telling the slave what to do.  If the login user is not a permitted user then everything aborts.  The first time that spiffa is run it is best to be root so that the GUI is available.  Add your login name to the user list in the Users page.  Also, while root, check that the Pathnames page gives the correct full pathnames.  The defaults should be correct in most cases.  Go through all the pages and view the tooltips to decide what should be entered and save each page.  The result, assuming the data is saved, is the file  /usr/local/etc/spiffa.conf which provides the default configuration.  If this has been created manually it must be made read/write for root and no-one else.

From the Command Line
A normal user, if permitted, runs a default backup as follows:-

[david@octopus ~]$ spiffa -b

and a default restore:-

[david@octopus ~]$ spiffa -r

and an update (i.e. incremental backup):-

[david@octopus ~]$ spiffa -u
[david@octopus ~]$ spiffa -i

One can also choose to restore from a different restore point with -prestorepoint.  For backup, update and restore it is possible to select a different configuration file from the default with -ffile.

First cd to the directory containing the .tar.gz file then extract the compressed tar file with something like:-

[david@octopus spiffa]$ tarzx spiffa-1.3.tar.gz


[david@octopus spiffa]$ tar xvzf spiffa-1.3.tar.gz

Note that I have the following added into my .bashrc file:-

This has been very useful over the years since I first came across the idea.  The command should result in a directory containing the uncompressed version.  The following assumes that the base for installing spiffa is /usr/local.

Now change to the top directory:-

[david@octopus spiffa]$ cd spiffa-1.3


[david@octopus spiffa-1.3]$ ./configure

Now either use a direct install or an rpm install.

A Direct  Install...
After ./configure as per the above:-

[david@octopus spiffa-1.3]$ make

To perform the actual install you have to be root so use the su command mentioned above then:-

[david@octopus spiffa-1.3]# make install

To uninstall it is also necessary to be root:-

[david@octopus spiffa-1.3]# make uninstall

This doesn't quite remove everything. See the "README" file.

That should be all there is to it but if it is necessary to experiment read up about the Gnu Build Tools first! 

An RPM  Install...
The easiest way is to change to the directory containing spiffa-1.3.tar.gz and then issue the following command as root:-

[david@octopus spiffa]# rpmbuild -ta spiffa-1.3.tar.gz

It is also possible to do it after extracting the source as follows:-

After ./configure as per the above, first make a new copy of spiffa-1.3.tar.gz.

[david@octopus spiffa-1.3]$ make dist

This will create a copy of spiffa-1.3.tar.gz in the spiffa-1.3 (i.e. top) directory.
Now become root using the su command mentioned above then to create the rpm:-

[david@octopus spiffa-1.3]# make rpm

This creates an rpm file of which the full pathname will be something like /usr/src/redhat/RPMS/i386/spiffa-1.3-1.i386.rpm depending on how the system is arranged.  It will also create debuginfo in the same directory and an srpm file in the appropriate SRPMS directory.  To install the rpm file first cd to its directory:-

[david@octopus ~]#
cd /usr/src/redhat/RPMS/i386

Make sure that you are still

Now to install 
spiffa issue the following command:-

[david@octopus i386]# rpm -ivh spiffa-1.2-1.i386.rpm

To remove it again, as
root issue the following command:-

[david@octopus ~]# 
rpm -e spiffa

Install to a different directory
For a direct install the appropriate information will have to be passed to configure, for example:-

[david@octopus ~]$ ./configure --bindir=/ --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var --mandir=/usr/share/man

For an rpm type of install it is necessary to modify the file spiffa.spec in the top directory prior to using the command make rpm. To obtain a similar result to above change the appropriate lines to:-

Prefix:                         /
%define bindir            %{prefix}/bin
%define datadir          %{prefix}/usr/share
%define sysconfdir      %{prefix}/etc
%define localstatedir   %{prefix}/var
%define mandir           %{prefix}/usr/share/man

This places everything into the places normally used by Fedora Core and Red Hat Linux. However, normally files and programs that are not part of a distribution are placed in /usr/local. The distribution should include the file spiffa.specX in the top directory. Move the original spiffa.spec to another directory and rename it as spiffa.specX. Rename spiffa.specX as spiffa.spec, then move the newly named spiffa.specX back, after which the make rpm command should create a Fedora 7 rpm file.

Useful Packaging Links
The packaging could be improved upon, so here are some sites that may help if it doesn't work as expected:-

Maximum RPM
Using Automake and Autoconf with C+
GNU Autoconf Automake and Libtool
Introduction to GNU Build Tools

A search with google reveals numerous other helpful sites.

Download spiffa-1.3.tar.gz                  HERE (size 879.8 KB)

or the Fedora 7 binary

Download spiffa-1.3-1.fc7.i386.rpm   HERE (size 598.8 KB)