pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Can't recover data from a .tar.gz file which was backed up using COPY BINARY command
3+ messages / 2 participants
[nested] [flat]

* Can't recover data from a .tar.gz file which was backed up using COPY BINARY command
@ 2012-03-01 07:51 Khangelani Gama <kgama@argility.com>
  2012-03-01 09:56 ` Re: Can't recover data from a .tar.gz file which was backed up using COPY BINARY command Matheus de Oliveira <matioli.matheus@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Khangelani Gama @ 2012-03-01 07:51 UTC (permalink / raw)
  To: pgsql-admin

Someone in our company wrote a script that backs up data from a certain
table, that person left the company and no one is able to figure it out.
Part of this script has something like, look at the COPY BINARY command
just below:



EXPORTFILE=${EXPORTFILE}.${AUD_UP_TO}_${MAX_AUDIT}

   *$PSQL -c "COPY BINARY dailybackup TO '$EF_PATH/$EXPORTFILE';"*



   if [ $? -eq 0 ]; then

      cd $EF_PATH

      tar cvzf ${EXPORTFILE}.tar.gz ${EXPORTFILE}

      if [ $? -ne 0 ]; then

         echo -e "Error while compressing tar file :  " >
/tmp/backup.trickle.state

         echo `date` >> /tmp/backup.trickle.state



fi



   echo "Backup to backup disk successful"



   echo "Update trickle checkpoint"



   ${ANT} run -Dclass=ucs.instore.ejb.system.SetTrickleCheckpoint
-Darg1=${MAX_AUDIT}







I tried to untar the file which went through fine, but now inside the file
there is funny characters, see below:



PGBCOPY

ÿ^M

^@^D^C^B^A^@^@^@^@^@^@^@^@^R^@^D^@~UIS^@ÿÿ
^@^@^@1~1~1^D^@^É^@^@^D^@^@^@^@^@ÿÿ^K^@^@^@day_endÿÿ^K^@^@^@central^H^@wIôðå϶Aÿÿ¶^B^@^@<?xml
version="1.0" encoding="UTF-8"?>^M





I am aware of the following format, but can’t figure out how many
characters should I specify and this backup system doesn’t use pg_dump
command?





COPY [ BINARY ] table_name [ WITH OIDS ]

    FROM { 'filename' | STDIN }

    [ [USING] DELIMITERS 'delimiter' ]

    [ WITH NULL AS 'null string' ]







Thanks in advanced





CONFIDENTIALITY NOTICE
The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of Argility (Proprietary) Limited and/or its subsidiaries. Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.
If you are not the intended addressee please notify the writer immediately and destroy the e-mail. Argility (Proprietary) Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Can't recover data from a .tar.gz file which was backed up using COPY BINARY command
  2012-03-01 07:51 Can't recover data from a .tar.gz file which was backed up using COPY BINARY command Khangelani Gama <kgama@argility.com>
@ 2012-03-01 09:56 ` Matheus de Oliveira <matioli.matheus@gmail.com>
  2012-03-01 10:16   ` Re: Can't recover data from a .tar.gz file which was backed up using COPY BINARY command Khangelani Gama <kgama@argility.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Matheus de Oliveira @ 2012-03-01 09:56 UTC (permalink / raw)
  To: Khangelani Gama <kgama@argility.com>; +Cc: pgsql-admin

Have you tried the above?

COPY BINARY dailybackup FROM <uncompressed file>

If so, what happened?

--
Matheus de Oliveira

Bacharelado em Ciências de Computação
Laboratório de Computação de Alto Desempenho -
LCAD<http://www.lcad.icmc.usp.br/;
Instituto de Ciências Matemáticas e de Computação -
ICMC<http://www.icmc.usp.br/;
Universidade de São Paulo - USP <http://www.sc.usp.br/;




On Thu, Mar 1, 2012 at 4:51 AM, Khangelani Gama <kgama@argility.com> wrote:

> Someone in our company wrote a script that backs up data from a certain
> table, that person left the company and no one is able to figure it out.
> Part of this script has something like, look at the COPY BINARY command
> just below:
>
>
>
> EXPORTFILE=${EXPORTFILE}.${AUD_UP_TO}_${MAX_AUDIT}
>
>    *$PSQL -c "COPY BINARY dailybackup TO '$EF_PATH/$EXPORTFILE';"*
>
>
>
>    if [ $? -eq 0 ]; then
>
>       cd $EF_PATH
>
>       tar cvzf ${EXPORTFILE}.tar.gz ${EXPORTFILE}
>
>       if [ $? -ne 0 ]; then
>
>          echo -e "Error while compressing tar file :  " >
> /tmp/backup.trickle.state
>
>          echo `date` >> /tmp/backup.trickle.state
>
>
>
> fi
>
>
>
>    echo "Backup to backup disk successful"
>
>
>
>    echo "Update trickle checkpoint"
>
>
>
>    ${ANT} run -Dclass=ucs.instore.ejb.system.SetTrickleCheckpoint
> -Darg1=${MAX_AUDIT}
>
>
>
>
>
>
>
> I tried to untar the file which went through fine, but now inside the file
> there is funny characters, see below:
>
>
>
> PGBCOPY
>
> ÿ^M
>
> ^@^D^C^B^A^@^@^@^@^@^@^@^@^R^@^D^@~UIS^@ÿÿ
> ^@^@^@1~1~1^D^@^É^@^@^D^@^@^@^@^@ÿÿ^K^@^@^@day_endÿÿ^K^@^@^@central^H^@wIôðå϶Aÿÿ¶^B^@^@<?xml
> version="1.0" encoding="UTF-8"?>^M
>
>
>
>
>
> I am aware of the following format, but can’t figure out how many
> characters should I specify and this backup system doesn’t use pg_dump
> command?
>
>
>
>
>
> COPY [ BINARY ] table_name [ WITH OIDS ]
>
>     FROM { 'filename' | STDIN }
>
>     [ [USING] DELIMITERS 'delimiter' ]
>
>     [ WITH NULL AS 'null string' ]
>
>
>
>
>
>
>
> Thanks in advanced
>
>
>
>
>
>
>
> CONFIDENTIALITY NOTICE
> The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of Argility (Proprietary) Limited and/or its subsidiaries. Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.
> If you are not the intended addressee please notify the writer immediately and destroy the e-mail. Argility (Proprietary) Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.
>
>
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Can't recover data from a .tar.gz file which was backed up using COPY BINARY command
  2012-03-01 07:51 Can't recover data from a .tar.gz file which was backed up using COPY BINARY command Khangelani Gama <kgama@argility.com>
  2012-03-01 09:56 ` Re: Can't recover data from a .tar.gz file which was backed up using COPY BINARY command Matheus de Oliveira <matioli.matheus@gmail.com>
@ 2012-03-01 10:16   ` Khangelani Gama <kgama@argility.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Khangelani Gama @ 2012-03-01 10:16 UTC (permalink / raw)
  To: Matheus de Oliveira <matioli.matheus@gmail.com>; +Cc: pgsql-admin

Hi Matheus



I get the following error when trying your command:



ERROR:  COPY BINARY: file signature not recognized







*From:* Matheus de Oliveira [mailto:matioli.matheus@gmail.com]
*Sent:* Thursday, March 01, 2012 11:56 AM
*To:* Khangelani Gama
*Cc:* pgsql-admin@postgresql.org
*Subject:* Re: [ADMIN] Can't recover data from a .tar.gz file which was
backed up using COPY BINARY command



Have you tried the above?

COPY BINARY dailybackup FROM <uncompressed file>

If so, what happened?

--
Matheus de Oliveira

Bacharelado em Ciências de Computação
Laboratório de Computação de Alto Desempenho -
LCAD<http://www.lcad.icmc.usp.br/;
Instituto de Ciências Matemáticas e de Computação -
ICMC<http://www.icmc.usp.br/;
Universidade de São Paulo - USP <http://www.sc.usp.br/;



On Thu, Mar 1, 2012 at 4:51 AM, Khangelani Gama <kgama@argility.com> wrote:

Someone in our company wrote a script that backs up data from a certain
table, that person left the company and no one is able to figure it out.
Part of this script has something like, look at the COPY BINARY command
just below:



EXPORTFILE=${EXPORTFILE}.${AUD_UP_TO}_${MAX_AUDIT}

   *$PSQL -c "COPY BINARY dailybackup TO '$EF_PATH/$EXPORTFILE';"*



   if [ $? -eq 0 ]; then

      cd $EF_PATH

      tar cvzf ${EXPORTFILE}.tar.gz ${EXPORTFILE}

      if [ $? -ne 0 ]; then

         echo -e "Error while compressing tar file :  " >
/tmp/backup.trickle.state

         echo `date` >> /tmp/backup.trickle.state



fi



   echo "Backup to backup disk successful"



   echo "Update trickle checkpoint"



   ${ANT} run -Dclass=ucs.instore.ejb.system.SetTrickleCheckpoint
-Darg1=${MAX_AUDIT}







I tried to untar the file which went through fine, but now inside the file
there is funny characters, see below:



PGBCOPY

ÿ^M

^@^D^C^B^A^@^@^@^@^@^@^@^@^R^@^D^@~UIS^@ÿÿ
^@^@^@1~1~1^D^@^É^@^@^D^@^@^@^@^@ÿÿ^K^@^@^@day_endÿÿ^K^@^@^@central^H^@wIôðå϶Aÿÿ¶^B^@^@<?xml
version="1.0" encoding="UTF-8"?>^M





I am aware of the following format, but can’t figure out how many
characters should I specify and this backup system doesn’t use pg_dump
command?





COPY [ BINARY ] table_name [ WITH OIDS ]

    FROM { 'filename' | STDIN }

    [ [USING] DELIMITERS 'delimiter' ]

    [ WITH NULL AS 'null string' ]







Thanks in advanced







CONFIDENTIALITY NOTICE

The contents of and attachments to this e-mail are intended for the
addressee only, and may contain the confidential information of
Argility (Proprietary) Limited and/or its subsidiaries. Any review,
use or dissemination thereof by anyone other than the intended
addressee is prohibited.

If you are not the intended addressee please notify the writer
immediately and destroy the e-mail. Argility (Proprietary) Limited and
its subsidiaries distance themselves from and accept no liability for
unauthorised use of their e-mail facilities or e-mails sent other than
strictly for business purposes.





CONFIDENTIALITY NOTICE
The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential information of Argility (Proprietary) Limited and/or its subsidiaries. Any review, use or dissemination thereof by anyone other than the intended addressee is prohibited.
If you are not the intended addressee please notify the writer immediately and destroy the e-mail. Argility (Proprietary) Limited and its subsidiaries distance themselves from and accept no liability for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2012-03-01 10:16 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-03-01 07:51 Can't recover data from a .tar.gz file which was backed up using COPY BINARY command Khangelani Gama <kgama@argility.com>
2012-03-01 09:56 ` Matheus de Oliveira <matioli.matheus@gmail.com>
2012-03-01 10:16   ` Khangelani Gama <kgama@argility.com>

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