Backup to Tape Incomplete

From: "Phillip Smith" <phillip(dot)smith(at)weatherbeeta(dot)com(dot)au>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Backup to Tape Incomplete
Date: 2008-02-25 03:20:34
Message-ID: 016d01c8775d$62382650$9b0014ac@wbaus090
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

PostgreSQL 8.2.4
RedHat ES4

I have a nightly cron job that is (supposed) to dump a specific database to
magnetic tape:
/usr/local/bin/pg_dump dbname > /dev/st0

This runs, and doesn't throw any errors, but when I try to restore it fails
because the tape is incomplete:
[postgres(at)stirling ~]$ cat /dev/st0 | tail


--
-- Name: rewards_points; Type: ACL; Schema: public; Owner: dbname
--

REVOKE ALL ON TABLE rewards_points FROM PUBLIC;
REVOKE ALL ON TABLE rewards_points FROM dbname;
GRANT ALL ON TABLE rewards_points TO dbname;
GRANT SELECT,INSERT,UPDATE ON TABLE rewards_points TO
PUBL[postgres(at)stirling ~]$

As you can see, the "end of file" is half-way through a SQL statement, and
doesn't even have a new-line marker.

The database is not too big for the tape - it's a DDS-3 tape drive (12/24gb)
and the database is not even 1gb:
[postgres(at)stirling ~]$ pg_dump dbname > /tmp/dbname080225.sql
[postgres(at)stirling ~]$ ls -lh /tmp/dbname080225.sql
-rw-r--r-- 1 postgres root 957M Feb 25 13:42 /tmp/dbname080225.sql

Is this a PostgreSQL issue or a tape drive issue? I can use tar to read and
write without any problems.

Do I need to change the block size on the tape drive?

[phillips(at)stirling ~]$ mt stat
SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 512 bytes. Density code 0x25 (DDS-3).
Soft error count since last status=0
General status bits on (41010000):
BOT ONLINE IM_REP_EN

THINK BEFORE YOU PRINT - Save paper if you don't really need to print this

*******************Confidentiality and Privilege Notice*******************

The material contained in this message is privileged and confidential to
the addressee. If you are not the addressee indicated in this message or
responsible for delivery of the message to such person, you may not copy
or deliver this message to anyone, and you should destroy it and kindly
notify the sender by reply email.

Information in this message that does not relate to the official business
of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta.
Weatherbeeta, its employees, contractors or associates shall not be liable
for direct, indirect or consequential loss arising from transmission of this
message or any attachments
e-mail.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Vishal Arora 2008-02-25 04:06:23 Re: WAL archiving
Previous Message Dawid Kuroczko 2008-02-25 01:02:17 Re: WAL archiving