Re: AFIO usage...
On Fri, 19 Jun 1998, Jay Barbee wrote:
> I was wondering how I would use AFIO to replace they way I use tar.
> Here is a sample:
> tar c -X /root/backup/exclude -f /mnt/scratch/linux/backup.tar /
>
> What I do not know how to do is exclude several file which are listed
> in the file "exclude" which looks like:
> ---
> /cdrom
> /home/public/old-system-backup/*
> cache*
> core
> ---
>
> The TAR command works, but I cannot figure out how to use AFIO in the same
> manner.
>
> Thanks,
> --Jay
Jay,
I didn't see anyone answer your question, so I dug out of my files this
extract from the man pages that I give to students who are beginnning
with Linux. Maybe with this and the man page you can figure a solution
to your problem.
I see no really good way to provide an exclude file. Exclude patterns
work pretty well though. Maybe someone will someone will tell both of us
how, if there is a way to do that.
All standard disclaimers apply :)
--David
Man page says:
... | afio -o [ options ] archive : write archive
afio -i [ options ] archive : install archive
afio -t [ options ] archive : list table-of-contents of
archive
afio -r [ options ] archive : verify archive against
filesystem
afio -p [ options ] directory [ ... ] : copy files
Frequently used options:
-v -Z -F -K -n
-s volsize -b blocksize -y pattern -Y pattern
Simplest case first:
Unlike tar which traverses the directory structure in accord with the
pattern you provide, afio takes a stream of paths to the files from the
standard input.
To generate your file list, you might do this:
cd root of the directory tree you want archived
find . -print > filelist
This produces your file list. You can edit it, if the files you want
to save do not change backup to backup you can just do this:
cat filelist | afio -o archive-name.afio
This will save all the files in filelist to the archive named
archive-name.afio. Use -Y pattern (see below) to exclude things.
To get a listing of the files in the archive,
afio -t archive-name.afio
To get an ls -l like listing,
afio -tv archive-name.afio
To verify
afio -r archive-name.afio
This will complain about missing files, and if a file is different
from the archive version, afio complains about a corrupt archive.
And to install the archive,
afio -i archive-name.afio
You can install just one file with
afio -i -y path-to-file archive-name.afio
Continuting the man page:
-o, reads pathnames from the standard input and
writes an archive.
With -t, reads an archive and writes a table-of-contents
to the standard output.
With -i, installs the contents of an archive relative to
the working directory.
With -p, reads pathnames from the standard input and
copies the files to each directory.
With -r, reads archive and verifies it against the
filesystem. This is useful for verifying tape archives.
Creates missing directories as necessary, with permissions
to match their parents.
Generates sparse filesystem blocks (with lseek(2)) when
possible.
Removes leading slashes from pathnames when reading, writ-
ing, and cataloging an archive, unless instructed not to.
Supports multi-volume archives during interactive opera-
tion (i.e., when /dev/tty is accessible and SIGINT is not
being ignored).
Frequently used options:
-v -Z -F -K -n
-s volsize -b blocksize -y pattern -Y pattern
-v verbose.
-Z Pass archive through gzip on archive, and through gunzip
when unarchiving.j
-F says, this is a floppy disk. causes O_SYNC mode with Linux.
with later kernels, detects floppy errors
-K verify output against what is in the memory copy of
the disk (a -F is required as well) READ THE MAN PAGE
-n protect newer existing files (by file mod time)
-s volsize limits the size of a multi-volume archive - say
you are backing to floppies of 1.9 MByte size (one of
the larg formats) or multiple small tapes. requires -f,
see man page.
-b blocksize read or write blocks of this size. You need to
know the block size for the tape device. For floppies
you can use block size of a disk block, or a multiple
(say a track, or cylender size).
The following patterns are shell regular expresssions:
-y pattern save ONLY file with name that match this pattern
-Y pattern EXCLUDE files with names matching this pattern
-w filename treats each line in filename as a -y pattern, a
way to get an include list.
-------------------------------------------------------------------
LINUX: the FREE 32 bit OS for [3456]86 PC's available NOW!
David B Teague | Ask me how user interface copyrights & software
teague@wcu.edu | patents make programing a dangerous business.
National Security Council nuclear explosion Treasury destabilize Pakistan
Delta Force atomic bomb India data encryption data encryption munitions
counter-intelligence wild porno sex gold bullion Soviet clipper terrorist
hydrazine ammonium nitrate fuel oil cocaine assassinate counterfeit spy
--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to:
- References:
- AFIO usage...
- From: "Jay Barbee" <sysjyb@adm105.adm.louisville.edu>