Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
fukawi2 committed Oct 7, 2014
2 parents 68337c0 + befb823 commit cbac2b0
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 71 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ bin: test src/$(PROJECT).sh

config: pgsql-backup.conf
# Install (without overwriting) configuration files
[[ -e $(DESTDIR)$(D_CNF)/pgsql-backup.conf ]] || \
[ -e $(DESTDIR)$(D_CNF)/pgsql-backup.conf ] || \
install -D -m 0644 $(PROJECT).conf $(DESTDIR)$(D_CNF)/pgsql-backup.conf

docs: $(PROJECT).pod
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Use `PREFIX` to change install location
make PREFIX=/opt install

You will probably want the script to run on a regular basis; you can do this
using cron. Create `/etc/cron.d/pgsql-backup with the following contents:
using cron. Create `/etc/cron.d/pgsql-backup` with the following contents:

0 1 * * * root /usr/local/bin/pgsql-backup

Expand Down
4 changes: 4 additions & 0 deletions pgsql-backup.conf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ CONFIG_MAXATTSIZE="4000"
## script uses a specific version (ie, if you have multiple instances of
## postgresql installed)
#CONFIG_PG_DUMP='/usr/bin/pg_dump'
#CONFIG_PG_DUMPALL='/usr/bin/pg_dumpall'
#CONFIG_PSQL='/usr/bin/psql'
#CONFIG_GZIP='/bin/gzip'
#CONFIG_BZIP2='/bin/bzip2'
Expand All @@ -60,6 +61,9 @@ CONFIG_DBEXCLUDE="template0"
# Include CREATE DATABASE in backup?
CONFIG_CREATE_DATABASE=yes

# Make a dump of the PostgreSQL globals (ie login roles)
#CONFIG_DUMP_GLOBALS=yes

# Which day do you want weekly backups? (1 to 7 where 1 is Monday)
CONFIG_DOWEEKLY=1

Expand Down
24 changes: 17 additions & 7 deletions pgsql-backup.pod
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ Type: C<yes> or C<no>

Default: yes

=head2 CONFIG_DUMP_GLOBALS

Make a dump of the PostgreSQL globals (ie login roles). If set to C<yes> then
pg_dumpall (NOT pg_dump) is called with with C<--globals-only> flag and output
is saved to a distinct file in the C<CONFIG_BACKUPDIR> path.

Type: C<yes> or C<no>

Default: yes

=head2 CONFIG_DOWEEKLY

Which day to create a weekly archive of the dumps. Use '0' to not do weekly
Expand Down Expand Up @@ -337,21 +347,21 @@ A sample hook is included: F<hook-postbackup.sh>

=head1 SECURITY

Database dumps created by this script are unencrypted; you should take into
consideration the following (incomplete list) of implications, especially if
your database(s) store sensitive information such as usernames, passwords,
credit card details or other personal information (espeically those of your
customers).
Database dumps created by this script are unencrypted by default; you should
take into consideration the following (incomplete list) of implications,
especially if your database(s) store sensitive information such as usernames,
passwords, credit card details or other personal information (especially those
of your customers).

=over 4

=item * When writing to disk, ensure the backup directory has restictive
permissions to prevent unauthorized users gaining access to the backups.

=item * Use the L</POSTBACKUP> hook to encrypt your backups.
=item * Enable encryption of the output files. See L</CONFIG_ENCRYPT>.

=item * When emailing backup dumps, avoid the emails being trasmitted over
untrusted networks (ie, the internet). Internal mail systems only. Be aware
untrusted networks (eg, the internet). Internal mail systems only. Be aware
of mail systems that archive emails may retain copies of your backups.

=item * If you don't administer the email server, please respect your email
Expand Down
Loading

0 comments on commit cbac2b0

Please sign in to comment.