I recently run pg_dump to backup database using this command using user postgres
: time pg_dump -j 4 -Fd -Z 3 db_profile -f /backup-nfs/
Previously, the size of backup-nfs was 100 G. The pg_dump
worked fine.
Then, the server admin increase it to 200 G. So I run Pg_dump
again. But this time it is throwing out error : could not create directory "backup-nfs" : no such file or directory found.
I can create file and directory just as normal by using postgres
account. But the pg_dump
can't
What might be the possible cause ? I have checked the chown
, its fine. I can also do a command like "ls-lah"
on the directory and its working fine too.
Updates : maybe I need to share this.
So, then I try many pg_dump combinations.
time pg_dump -U postgres -j 3 -F d -Z 3 -t tbl_test -f /backup/**somefolder**/db_profile.back db_profile
-- does not work. ERROR : Could not open file '/var/lib/postgresql/backup/somefolder/backup.bak : No such file or directorytime pg_dump -U postgres -F c -t profile db_profile -f **>** /backup-nfs/profile.bak
-- technically, it works. I add directive ">". I thought it was working because of the directive. BUT, the file size is 0. So, it does not qualify to be working.I run again #2. -- ERROR :
permission denied
. I thought the">"
was the key, but it is not. Why does not it work ? It was just working a minute ago. Also, I have deleted the files from the previous backup.I try another command without
-f
, just the directive :pg_dump -h 10.100.8.42 -Fc db_profile -t profile > /backup-nfs/dump.sql
-- It works. The file is created too.I try another one :
pg_dump -h 10.100.8.42 -t jpt_non_pns -d db_profile -f /backup-nfs/dump_directive.bak
-- It works as well. The file is created too.
Questions :
- why does it need different combination of parameters to work ? On my local server, it takes all combinations and still working fine.
- There was a command that works when executed the first time. Then it did not work the second time eventhough I have cleared the previous backup completely. Why does it behave like this?
Thanks