CRON Jobs and Backups

Lists: pgsql-novice
From: Sean Montague <couloir007(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: phppgadmin
Date: 2005-06-01 19:05:40
Message-ID: 429E0704.1020507@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

When I try to remove a database with phppgadmin, I get the following error, "ERROR: cannot drop the currently open database". Any insight would be appreciated.

Sean


From: Volkan YAZICI <volkan(dot)yazici(at)gmail(dot)com>
To: couloir007(at)yahoo(dot)com
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: phppgadmin
Date: 2005-06-06 08:01:41
Message-ID: 7104a7370506060101731a8f82@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Hi,

On 6/1/05, Sean Montague <couloir007(at)yahoo(dot)com> wrote:
> When I try to remove a database with phppgadmin, I get the following
> error, "ERROR: cannot drop the currently open database". Any insight
> would be appreciated.

You cannot cut the branch you're on. :)

Try to connect template1 (or template0) then remove that
_not_connected_ database. AFAIC, you couldn't remove a database
serving at the moment.

Regards.


From: John DeSoi <desoi(at)pgedit(dot)com>
To: couloir007(at)yahoo(dot)com
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: phppgadmin
Date: 2005-06-06 12:56:24
Message-ID: 687a464622970d6f48b9ba1047c032b1@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice


On Jun 1, 2005, at 3:05 PM, Sean Montague wrote:

> When I try to remove a database with phppgadmin, I get the following
> error, "ERROR: cannot drop the currently open database". Any insight
> would be appreciated.

Seems like a bug to me. I thought the "Logout" link would help, but I
could not find a way to make it work.

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


From: Volkan YAZICI <volkan(dot)yazici(at)gmail(dot)com>
To: John DeSoi <desoi(at)pgedit(dot)com>
Cc: couloir007(at)yahoo(dot)com, pgsql-novice(at)postgresql(dot)org
Subject: Re: phppgadmin
Date: 2005-06-06 13:19:34
Message-ID: 7104a7370506060619397fc418@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Hi,

On 6/6/05, John DeSoi <desoi(at)pgedit(dot)com> wrote:
> On Jun 1, 2005, at 3:05 PM, Sean Montague wrote:
> > When I try to remove a database with phppgadmin, I get the following
> > error, "ERROR: cannot drop the currently open database". Any insight
> > would be appreciated.
>
> Seems like a bug to me. I thought the "Logout" link would help, but I
> could not find a way to make it work.

Oops. You seem to be right. (I can drop it by opening a SQL query
window from phpPgAdmin and executing "DROP DATABASE".) It could be a
bug. (I tried to dig a little bit in source code but, it requires an
experience on the program design. So just messed up.)

Regards.


From: <operationsengineer1(at)yahoo(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: CRON Jobs and Backups
Date: 2005-06-06 17:07:39
Message-ID: 20050606170739.14446.qmail@web52404.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

hi all,

i've googled and searche dmy pgsql books and i can't
quite get a confident grasp on cron jobs.

as i understand it... the following should enable me
to backup via cron:

PGUSER=postgres
PGPASSWORD=password
export PGUSER PGPASSWORD
pg_dump databasename | gzip > databasename.bak.gz

my interfaces is cpanel and it only gives me one line
to type this in... can i replace the returns with a
space and will this still work?

eg, PGUSER=postgres PGPASSWORD=password export...

will databasename.bak.gz be stored in the same file as
my database?

how can i store the file on my local computer?

i finally have some data in my db and i scared of
losing it. *real* scared!

tia...


__________________________________
Discover Yahoo!
Have fun online with music videos, cool games, IM and more. Check it out!
http://discover.yahoo.com/online.html


From: Philip Hallstrom <postgresql(at)philip(dot)pjkh(dot)com>
To: operationsengineer1(at)yahoo(dot)com
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: CRON Jobs and Backups
Date: 2005-06-06 17:49:19
Message-ID: 20050606104738.S5184@wolf.pjkh.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

> hi all,
>
> i've googled and searche dmy pgsql books and i can't
> quite get a confident grasp on cron jobs.
>
> as i understand it... the following should enable me
> to backup via cron:
>
> PGUSER=postgres
> PGPASSWORD=password
> export PGUSER PGPASSWORD
> pg_dump databasename | gzip > databasename.bak.gz
>
> my interfaces is cpanel and it only gives me one line
> to type this in... can i replace the returns with a
> space and will this still work?
>
> eg, PGUSER=postgres PGPASSWORD=password export...

Don't know about that... read up on /bin/sh to see how it handles things
like that.

If cpanel let's you upload files, you could put all of the above in a
'backup-pgsql.sh" file on your server then in your cron job put:

/bin/sh backup-pgsql.sh

> will databasename.bak.gz be stored in the same file as
> my database?

probably not. If I were you, I'd put the full path of where you want the
file to be stored.

> how can i store the file on my local computer?

Mail it to yourself, or download it via FTP/HTTP...

-philip


From: Andreas Kretschmer <akretschmer(at)despammed(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: [despammed] CRON Jobs and Backups
Date: 2005-06-06 18:31:08
Message-ID: 20050606183108.GA21560@webserv.wug-glas.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

am 06.06.2005, um 10:07:39 -0700 mailte operationsengineer1(at)yahoo(dot)com folgendes:
> PGUSER=postgres
> PGPASSWORD=password
> export PGUSER PGPASSWORD
> pg_dump databasename | gzip > databasename.bak.gz
>
> my interfaces is cpanel and it only gives me one line
> to type this in... can i replace the returns with a
> space and will this still work?
>
> eg, PGUSER=postgres PGPASSWORD=password export...
>
> will databasename.bak.gz be stored in the same file as
> my database?

No, the database will be stored in 'databasename.bak.gz'.

>
> how can i store the file on my local computer?

Call pg_dump from your computer, but with -h - parameter.

> i finally have some data in my db and i scared of
> losing it. *real* scared!

?

I used today:

pg_dump -h 'old_server' -n 'schema' -U 'user' 'db' | psql -U 'user' 'new_deb'

(just as a brain-dump, no guarantee)

to transfer a Database from a old to a new Server.

Andreas
--
Andreas Kretschmer (Kontakt: siehe Header)
Heynitz: 035242/47212, D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
=== Schollglas Unternehmensgruppe ===


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: operationsengineer1(at)yahoo(dot)com
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: CRON Jobs and Backups
Date: 2005-06-07 04:43:27
Message-ID: 25900.1118119407@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

<operationsengineer1(at)yahoo(dot)com> writes:
> as i understand it... the following should enable me
> to backup via cron:

> PGUSER=postgres
> PGPASSWORD=password
> export PGUSER PGPASSWORD
> pg_dump databasename | gzip > databasename.bak.gz

This is probably a pretty bad way to handle the password --- on many
Unix variants, anyone can see the list of environment variables that is
passed down to the pg_dump process. It'd be far safer to put the
password in a ~/.pgpass file owned by the Unix user that runs the cron
job.

> my interfaces is cpanel and it only gives me one line
> to type this in... can i replace the returns with a
> space and will this still work?

Get a better user interface ;-). Or put the whole mess in a script file
and invoke the script file from your cron job.

regards, tom lane


From: Aarni Ruuhimäki <aarni(at)kymi(dot)com>
To: <operationsengineer1(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: CRON Jobs and Backups
Date: 2005-06-07 07:52:09
Message-ID: 200506071052.09795.aarni@kymi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Hi,

Here's simple instructions and sample for sftp and cron (linux), which should
give you an idea how it works. You can then create your own scripts for the
actual job.

http://tennis.ecs.umass.edu/~czou/linux/backupSSH.html

BR,

Aarni

On Monday 06 June 2005 20:07, you wrote:
> hi all,
>
> i've googled and searche dmy pgsql books and i can't
> quite get a confident grasp on cron jobs.
>
> as i understand it... the following should enable me
> to backup via cron:
>
> PGUSER=postgres
> PGPASSWORD=password
> export PGUSER PGPASSWORD
> pg_dump databasename | gzip > databasename.bak.gz
>
> my interfaces is cpanel and it only gives me one line
> to type this in... can i replace the returns with a
> space and will this still work?
>
> eg, PGUSER=postgres PGPASSWORD=password export...
>
> will databasename.bak.gz be stored in the same file as
> my database?
>
> how can i store the file on my local computer?
>
> i finally have some data in my db and i scared of
> losing it. *real* scared!
>
> tia...
>
>
>
> __________________________________
> Discover Yahoo!
> Have fun online with music videos, cool games, IM and more. Check it out!
> http://discover.yahoo.com/online.html
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq

--
Aarni Ruuhimäki
Megative Tmi
Pääsintie 26
45100 Kouvola
Finland
+358-5-3755035
+358-50-4910037

www.kymi.com | cfm.kymi.com
--------------
This is a bugfree broadcast to you
from **Kmail**
on **Fedora Core 2** linux system
--------------
Linux is like a wigwam - no windows, no gates and a free apache inside.


From: Frank Bax <fbax(at)sympatico(dot)ca>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: CRON Jobs and Backups
Date: 2005-06-08 13:13:29
Message-ID: 5.2.1.1.0.20050608091027.02cac3f0@pop6.sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

Depends. If you have only one database, I suppose tar/zip everything
together might be tempting. I host several domains, each with their own
databases. I use pg_dump for data backup; use the original install package
as backup to binaries; and make copies of config/startup.

Frank

At 10:11 AM 6/8/05, Todd Lewis wrote:

>I've started looking at backup options myself. Which is better, tar
>zipping the binaries and data files together, separately, or just running
>pg_dump.
>
>Aarni Ruuhimäki wrote:
>
>>Hi,
>>
>>Here's simple instructions and sample for sftp and cron (linux), which
>>should give you an idea how it works. You can then create your own
>>scripts for the actual job.
>>
>>http://tennis.ecs.umass.edu/~czou/linux/backupSSH.html
>>
>>BR,
>>
>>Aarni
>>
>>
>>On Monday 06 June 2005 20:07, you wrote:
>>
>>
>>>hi all,
>>>
>>>i've googled and searche dmy pgsql books and i can't
>>>quite get a confident grasp on cron jobs.
>>>
>>>as i understand it... the following should enable me
>>>to backup via cron:
>>>
>>>PGUSER=postgres
>>>PGPASSWORD=password
>>>export PGUSER PGPASSWORD
>>>pg_dump databasename | gzip > databasename.bak.gz
>>>
>>>my interfaces is cpanel and it only gives me one line
>>>to type this in... can i replace the returns with a
>>>space and will this still work?
>>>
>>>eg, PGUSER=postgres PGPASSWORD=password export...
>>>
>>>will databasename.bak.gz be stored in the same file as
>>>my database?
>>>
>>>how can i store the file on my local computer?
>>>
>>>i finally have some data in my db and i scared of
>>>losing it. *real* scared!
>>>
>>>tia...
>>>
>>>
>>>
>>>__________________________________
>>>Discover Yahoo!
>>>Have fun online with music videos, cool games, IM and more. Check it out!
>>>http://discover.yahoo.com/online.html
>>>
>>>---------------------------(end of broadcast)---------------------------
>>>TIP 5: Have you checked our extensive FAQ?
>>>
>>> http://www.postgresql.org/docs/faq
>>>
>>
>>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faq


From: Todd Lewis <lewis-todd(at)sbcglobal(dot)net>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: CRON Jobs and Backups
Date: 2005-06-08 14:11:25
Message-ID: 42A6FC8D.6050405@sbcglobal.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

I've started looking at backup options myself. Which is better, tar
zipping the binaries and data files together, separately, or just
running pg_dump.

Aarni Ruuhimäki wrote:

>Hi,
>
>Here's simple instructions and sample for sftp and cron (linux), which should
>give you an idea how it works. You can then create your own scripts for the
>actual job.
>
>http://tennis.ecs.umass.edu/~czou/linux/backupSSH.html
>
>BR,
>
>Aarni
>
>
>On Monday 06 June 2005 20:07, you wrote:
>
>
>>hi all,
>>
>>i've googled and searche dmy pgsql books and i can't
>>quite get a confident grasp on cron jobs.
>>
>>as i understand it... the following should enable me
>>to backup via cron:
>>
>>PGUSER=postgres
>>PGPASSWORD=password
>>export PGUSER PGPASSWORD
>>pg_dump databasename | gzip > databasename.bak.gz
>>
>>my interfaces is cpanel and it only gives me one line
>>to type this in... can i replace the returns with a
>>space and will this still work?
>>
>>eg, PGUSER=postgres PGPASSWORD=password export...
>>
>>will databasename.bak.gz be stored in the same file as
>>my database?
>>
>>how can i store the file on my local computer?
>>
>>i finally have some data in my db and i scared of
>>losing it. *real* scared!
>>
>>tia...
>>
>>
>>
>>__________________________________
>>Discover Yahoo!
>>Have fun online with music videos, cool games, IM and more. Check it out!
>>http://discover.yahoo.com/online.html
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 5: Have you checked our extensive FAQ?
>>
>> http://www.postgresql.org/docs/faq
>>
>>
>
>
>


From: Aarni Ruuhimäki <aarni(at)kymi(dot)com>
To: Frank Bax <fbax(at)sympatico(dot)ca>, Todd Lewis <lewis-todd(at)sbcglobal(dot)net>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: CRON Jobs and Backups
Date: 2005-06-09 09:57:01
Message-ID: 200506091257.01964.aarni@kymi.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-novice

On Wednesday 08 June 2005 16:13, you wrote:
> Depends. If you have only one database, I suppose tar/zip everything
> together might be tempting. I host several domains, each with their own
> databases. I use pg_dump for data backup; use the original install package
> as backup to binaries; and make copies of config/startup.

Yes, depends.

I use sftp / ssh, cron jobs and little shell scripts to do various tasks. I
have also several virtual domains hosted with their own databases and amongst
other things take a nightly 'pg_dumpall -c'.

I also backup other system info and data like:

#!/bin/bash
#
#Backup-script
#
cd /var/backup # here we tar the files

tar cfz wusage.gz /var/wusage-accounts/

tar cfz pg_my.gz /usr/share/db_dumps/all/

tar cfz usr_local.gz /usr/local/

tar cfz etc.gz /etc/

...

And then retrieve stuff from /var/backup to other machines.

BR,

Aarni

>
> Frank
>
> At 10:11 AM 6/8/05, Todd Lewis wrote:
> >I've started looking at backup options myself. Which is better, tar
> >zipping the binaries and data files together, separately, or just running
> >pg_dump.
> >
> >Aarni Ruuhimäki wrote:
> >>Hi,
> >>
> >>Here's simple instructions and sample for sftp and cron (linux), which
> >>should give you an idea how it works. You can then create your own
> >>scripts for the actual job.
> >>
> >>http://tennis.ecs.umass.edu/~czou/linux/backupSSH.html
> >>
> >>BR,
> >>
> >>Aarni
> >>
> >>On Monday 06 June 2005 20:07, you wrote:
> >>>hi all,
> >>>
> >>>i've googled and searche dmy pgsql books and i can't
> >>>quite get a confident grasp on cron jobs.
> >>>
> >>>as i understand it... the following should enable me
> >>>to backup via cron:
> >>>
> >>>PGUSER=postgres
> >>>PGPASSWORD=password
> >>>export PGUSER PGPASSWORD
> >>>pg_dump databasename | gzip > databasename.bak.gz
> >>>
> >>>my interfaces is cpanel and it only gives me one line
> >>>to type this in... can i replace the returns with a
> >>>space and will this still work?
> >>>
> >>>eg, PGUSER=postgres PGPASSWORD=password export...
> >>>
> >>>will databasename.bak.gz be stored in the same file as
> >>>my database?
> >>>
> >>>how can i store the file on my local computer?
> >>>
> >>>i finally have some data in my db and i scared of
> >>>losing it. *real* scared!
> >>>
> >>>tia...
> >>>
> >>>
> >>>
> >>>__________________________________
> >>>Discover Yahoo!
> >>>Have fun online with music videos, cool games, IM and more. Check it
> >>> out! http://discover.yahoo.com/online.html
> >>>
> >>>---------------------------(end of broadcast)---------------------------
> >>>TIP 5: Have you checked our extensive FAQ?
> >>>
> >>> http://www.postgresql.org/docs/faq
> >
> >---------------------------(end of broadcast)---------------------------
> >TIP 5: Have you checked our extensive FAQ?
> >
> > http://www.postgresql.org/docs/faq
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

--
Aarni Ruuhimäki
Megative Tmi
Pääsintie 26
45100 Kouvola
Finland
+358-5-3755035
+358-50-4910037

www.kymi.com | cfm.kymi.com
--------------
This is a bugfree broadcast to you
from **Kmail**
on **Fedora Core 2** linux system
--------------
Linux is like a wigwam - no windows, no gates and a free apache inside.