473,385 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

backup using cron

I'm sure this has been discussed many times. I can find references to
the problem in the archives, but decided to query the list here instead
of sifting through archives all day.

Is there a way to automate backup (perhaps using cron)? Of course, I am
having problems when requiring passwords. I do not want to provide
passwordless access via pg_hba.conf, then anyone could see the database
if they know the user name, correct? I am running version 7.4.3.

--
Robert
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 23 '05 #1
2 2257
Robert Fitzpatrick wrote:
I'm sure this has been discussed many times. I can find references to
the problem in the archives, but decided to query the list here instead
of sifting through archives all day.

Is there a way to automate backup (perhaps using cron)? Of course, I am
having problems when requiring passwords. I do not want to provide
passwordless access via pg_hba.conf, then anyone could see the database
if they know the user name, correct? I am running version 7.4.3.


I have something like this in my crontab:

$ crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.2882 installed on Tue Mar 2 22:49:07 2004)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
1 1 * * * /usr/local/bin/pg_db_backup

$ cat /usr/local/bin/pg_db_backup
#!/bin/sh
pg_dump --format=c --file=/home/promise/backup/promise.dump \
-Upromise promise
vacuumdb --analyze --verbose -Upromise promise \
2>/home/promise/backup/vacuum.log

You can place password details in a file (~/.pgpass) - see the manuals
(client interfaces/libpq/files) for details.

HTH
--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #2
On Tue, Jul 06, 2004 at 13:41:15 -0400,
Robert Fitzpatrick <ro****@webtent.com> wrote:

Is there a way to automate backup (perhaps using cron)? Of course, I am
having problems when requiring passwords. I do not want to provide
passwordless access via pg_hba.conf, then anyone could see the database
if they know the user name, correct? I am running version 7.4.3.


If you are using ident authentication then you can restrict usage of
various postgres usernames to various system usernames. For example
you could allow the system user root to connect as the postgres user
postgres, but not let anyone connect as postgres.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Neil | last post by:
Hi, I hope this question isn't too far off topic....I'm almost at my wits end trying to figure this out. I have a Mysql database and I wish to automate the backup of the database because I...
5
by: Sims | last post by:
Hi, Assuming the table MYTABLE, i want to run a script to backup the table. But there does not seem to be a straight forward function in MySQL to achieve it, Something like COPY TABLE...
1
by: Konrad | last post by:
I have an internet portal based on MySql database and what I need is to make a database backup , after each actualization of data. I know how should PHP code look like but I have no idea how to...
6
by: Mosher | last post by:
Hi all, I am wanting to automatically do dump of a mysql database nightly using cron and some kind of script that will email the whole db structure to me (as an attachment or as plain text in my...
2
by: Raffi | last post by:
I use the --all-databases switch to backup my entire database. Sometimes there's a need to restore individual databases or tables form the backup file. What command should I use for this? ...
6
by: sherryonline | last post by:
i have a page and i need that page to be called every day at 12:00 that page is going to connect to the database fetch some emails and will start mailing them how i am goning to do this.
7
by: Toralf Kirsten | last post by:
Hi, we are using DB2 on Fedora We try to backup the datbases automatically every day (night). For this purpose, I wrote two scripts, a shell (bash) and a sql script. The shell script set the...
3
by: mrwheel | last post by:
Hello I am seeking after a backup script, to take backup of my webspace on my server, my server is www.servage.net i need to take backup 2 times per day. Via cronjob on www.cronjob.de but i have...
7
by: damezumari | last post by:
I use Windows XP and Apache. I am trying to backup a database on my local computer with the following php code: $dbname = 'ol'; $dbhost = 'localhost'; $dbuser = 'root'; $dbpass =...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.