LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-31-2003, 02:02 PM   #1
squadja
LQ Newbie
 
Registered: Jul 2003
Location: Hamilton
Distribution: Redhat 9.0
Posts: 7

Rep: Reputation: 0
Postgresql and Crontab


hello,
Now that I have figured out how to send an attachment with crontab, I am attempting to add the backup procedure to the cronjob.

su postgres
pg_dumpall > test



and the error I keep getting is:
postgres does not know where to find the database system data. You must specify the directory that contains the database system either by specifying the -D invocation option or by setting the PGDATA environment variable.

HELP!!

Thanks
 
Old 08-15-2003, 09:05 AM   #2
jdruin
Member
 
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313

Rep: Reputation: 30
hello squadja:

Do a:

find / -name data

This may print several results. Look specifically for either:

/var/lib/pgsql/data

-or-

/usr/local/pgsql/data

Hopefully you will only see one or the other. If you see both, there is a different issue to contend with. Whichever you see, that is the path to your postgresql data directory. Mine happens to be the /var/lib/pgsql/data so when I invoke the command you refer to above I would say:

pg_dumpall -D /var/lib/pgsql/data > test

Postgresql must know this path to do nearly any pg command so it would be helpful to set up the variable it looks for by default, which is PGDATA. To do this go to your:

/etc/profile

file and add this to the file:

PGDATA = /var/lib/pgsql/data
export PGDATA

assuming your search for the data directory produces the same path as mine. Good luck.
 
Old 08-15-2003, 01:11 PM   #3
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Re: Postgresql and Crontab

Quote:
Originally posted by squadja
and the error I keep getting is:
postgres does not know where to find the database system data. You must specify the directory that contains the database system either by specifying the -D invocation option or by setting the PGDATA environment variable.
That error message was not a big enough clue?
 
Old 08-15-2003, 01:29 PM   #4
jdruin
Member
 
Registered: Jul 2003
Location: Louisville aka Derby City
Distribution: WinXP SP2 and SP3, W2K Server, Ubuntu
Posts: 313

Rep: Reputation: 30
...kind of a harsh retort. One of the reasons people hate Linux (yes, its true, lots of people hate Linux!) is because they get bashed in the head for asking questions. If the learning curve doesnt get them, they get sick of getting piled on every time they open their pie hole. I ahve put in my time reading thousands on pages of docs, books, mans, etc. but I still hate getting blasted for asking a "stupid" question. Give newbies slack. Isn't the whole point of this entire website to ask questions?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PostgreSql sijomon_nd Fedora 1 09-27-2005 09:27 PM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 12:35 PM
postgresql -odbc & postgresql-jdbc installation kjsubbu Linux - Software 0 06-19-2003 02:50 AM
postgreSQL dsgdevil Linux - Software 3 02-20-2003 10:30 PM
PostgreSQL dorian33 Linux - Software 3 01-15-2003 04:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration