Re: Shell Script help for backup - Mailing list pgsql-general

From ratlhead@ratlhead.com (ratlhead)
Subject Re: Shell Script help for backup
Date
Msg-id fd9c5ab3.0207250228.35baecb7@posting.google.com
Whole thread Raw
In response to Re: Shell Script help for backup  (strange@nsk.yi.org)
Responses Re: Shell Script help for backup  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-general
strange@nsk.yi.org wrote in message news:<20020723150902.A5173@nsk.yi.org>...
> What's wrong with the solution I sent?
>
> And I doubt the checking for a 0k file will work for you as gzip will
> create a 20 byte file even for a 0 byte input (some headers, etc.).
>
> Regards,
> Luciano Rocha

Luciano,

Was wondering if you could provide some help with the solution you
sent...

[ "$( zcat /folder/pg_backup.$DATE.gzip | head -c1 | wc -c )" -eq 1 ]

First, I can't seem to use zcat, because it likes to add on a ".Z" to
the filename for some reason or another.  Also, I find with the
version of 'head' installed on my machine, that -c isn't available,
but instead, -n.  I tried changing that and zcat to cat, but was
getting a fail on something that should be valid.

This basically checks to see if the file contains data right?

Thanks man!

pgsql-general by date:

Previous
From: jgdon
Date:
Subject: psql ... does not like my user ... help please ;-)
Next
From: "Henrik Steffen"
Date:
Subject: select distinct error ?