[Techtalk] backup - tar

Conor Daly c.daly at met.ie
Thu Sep 2 07:44:17 EST 2004


On Wed, Sep 01, 2004 at 05:42:24PM -0700 or thereabouts, Maria McKinley wrote:
> 
> Maybe there is a way to write a script that would list all directories 
> that first letter is a-m and output it to a file, same for n-z.  That 
> would get around the human error element of dividing home in half. 
> Unfortunately looking at man ls, I don't see an easy way of doing this.

Just had a look and I don't see a char equivalent for seq (echos numbers in
sequence) but the following will work:

create the file 'alpha' containing one letter per line (you probably need
upper and lowercase also).  Then, in your script, do:

for $LETTER in `grep [a-n] alpha`; do
  ls -d /home/${LETTER}*
done

The '-d' switch tells ls to list directory names rather than contents.
It'll still list files too.

BTW, our (ingres) database backup method consists of a 'checkpoint' where
the DB creates a 'dumpfile' into which all transactions go while the
checkpoint is running.  The main DB is then frozen and backed up to tape (I
believe it uses tar).  Once the checkpoint finishes, the contents of the
dumpfile are applied to the DB thus ensuring a consistent DB during the
backup without inconveniencing users.

Conor
-- 
Conor Daly,                   Please avoid sending me 
Met Eireann, Glasnevin Hill,  Word or PowerPoint attachments.
Dublin 9, Ireland             http://www.fsf.org/philosophy/no-word-attachments.html
Ph +3531 8064276 Fax +3531 8064247


**********************************************************************
This e-mail and any files transmitted with it are confidential 
and intended solely for the addressee. If you have received
this email in error please notify the sender.
This e-mail message has also been scanned for the
presence of computer viruses.
**********************************************************************



More information about the Techtalk mailing list