From: Phillip Smith <phillip.smith@weatherbeeta.com.au>
To: pgsql-admin@postgresql.org
Subject: Backup to Tape Incomplete
Date: Mon, 25 Feb 2008 14:20:34 +1100
Message-ID: <016d01c8775d$62382650$9b0014ac@wbaus090> (raw)
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@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@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@stirling ~]$ pg_dump dbname > /tmp/dbname080225.sql
[postgres@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@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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: phillip.smith@weatherbeeta.com.au
Subject: Re: Backup to Tape Incomplete
In-Reply-To: <016d01c8775d$62382650$9b0014ac@wbaus090>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox