My backup script is working really well, even burns some files to a
dvd.  I'm impressed (and don't get out much).  So of course I now need
to test my backups (like we all do - right?).  The problem I am having
is how to then extract the contents of the tar files - all from a script. 

The backup files are all named via a declaration in the initial backup
script, based on date like this:

TarData=backup-data-`date +%a-%d-%m-%y`.tgz

and I end up with a file called backup-data-Sun-01-04-07.tgz (similarly
backup-email-Sun-01-04-07.tgz and backup-home-Sun-01-04-07.tgz etc).

Simple enough to get them copied off the dvd into some folder - mount
the disk, and then cp backup* /pathto/some/folder/.  All good up to this
point.  I can also extract the contents of the tar files in a similar
way using:

tar -xvf $TarData

and this too is all good, I get a restored copy of all my data.  But
this only works if it is the run on the same day as the tar file was
made.  How can I modify my "tar -xvf" line when I do not know the full
names of my backup files - but do know the first few characters?  I
can't simply use wildcards i.e. tar -xvf back*.  Google hasn't been
friendly to me today.

Cheers,
Roger

Reply via email to