1

We have a need to send PostgreSQL DB backup to CRM developer. We send them and get feedback that the backup can't be "uzipped", as archive is broken.

The backup script snippet looks like this:

pg_dump -c -O -U postgres $x -h localhost -p 5432 --disable-dollar-quoting -i | gzip > $BACKUPDIR/$DT-$x.gz

We chceck the backup process and in our opinion there is no any issue with backuping system.

btw. They used 7Zip to unzip.

Question: What would you suggest to me to say to CRM Development Team .... what could be the problem ?

btw. In fact as so far we do not do any test for restoring, and I know must do this due to the security reason.

Question 2 We found that on Linux server all was properly backuped. When we copy them with to SMB resource and get to Windows station then even 7zip is unpacking them correctly.

We found that the problem is with sending them to local FTP server. We are sending this files by this BASH script:

#!/bin/sh
echo FTP file: 1ドル UPLOAD START
#pwd
ftp -n 192.168.1.205 <<END_SCRIPT
quote user userslogin
quote pass userspassw
cd /Backup
pwd
put 1ドル
quit
quit
END_SCRIPT
exit 0

Could somebody say how to improve/fix our FTP bash script ?

asked Feb 5, 2021 at 13:43
3
  • I get the error message pg_dump: invalid option -- 'i' Commented Feb 5, 2021 at 17:04
  • Documentation says --ignore-version .... A deprecated option that is now ignored. I se that I must to review this backup script. Commented Feb 5, 2021 at 17:28
  • 1
    Starting in 9.5, it went from 'ignored' to invalid. Commented Feb 5, 2021 at 17:57

1 Answer 1

1

You should tell them the way you generated the dump, since it is somewhat unusual. One obvious problem may be that they tried a decompression program that does not understand GNU zip.

I recommend to use the custom format:

pg_dump -F c -U postgres -f outfile.dmp $x

That can be restored with pg_restore, and it is automatically compressed.

answered Feb 5, 2021 at 13:53
5
  • I forget to mention that they use 7Zip to unzip. (already suplemented my question) Commented Feb 5, 2021 at 14:03
  • 2
    Of course something could have gone wrong during the file transfer. Compare checksums. Commented Feb 5, 2021 at 14:06
  • It was related to file transfer. Please read in opening post Question 2. Commented Feb 11, 2021 at 15:39
  • 1
    Switch FTP to binary mode? Commented Feb 11, 2021 at 15:43
  • Thanks. using This linked answer I do the trick. Commented Feb 11, 2021 at 16:20

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.