Re: CRON Jobs and Backups

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
Thread:
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.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Celia McInnis 2005-06-09 17:35:24 breaking out of a loop in plpgsql
Previous Message Van Ingen, Lane 2005-06-08 20:15:53 SubQuery Question