Just closing out this thread...
Thanks to your and Neill and others' help, I've settled on this for my
nightly job, that also deletes the oldest hourly's and daily over a
certain number to keep:
#!/bin/bash
BACKUP_DIR=/my/backups/app/sql/nightly
BACKUP_DIR_hourly=/my/backups/app/sql/hourly
On Sun, 05 May 2013 19:21:18 -0400, Tanstaafl wrote:
For example, I want to keep 17 hourlies, and 30 nightlies, so I have
two cron jobs set up, the hourly, and the nightly. Each backs up to a
separate dir.
So each time your backup fails, you reduce the number of available
backups by one. If
Ok, another little thing...
Is there a simple way to use date/time variables in cronjobs? Or do I
need to use a bash script for this? I prefer simple, and just using the
variables directly in the cron command would be easier if it works, so
figured I'd ask first...
I'm trying to schedule a
On Sunday 05 May 2013 17:56:33 Tanstaafl wrote:
Ok, another little thing...
Is there a simple way to use date/time variables in cronjobs? Or do I
need to use a bash script for this? I prefer simple, and just using the
variables directly in the cron command would be easier if it works, so
On 2013-05-05 1:07 PM, Mick michaelkintz...@gmail.com wrote:
On Sunday 05 May 2013 17:56:33 Tanstaafl wrote:
Ok, another little thing...
Is there a simple way to use date/time variables in cronjobs? Or do I
need to use a bash script for this? I prefer simple, and just using the
variables
On 05/05/2013 18:56, Tanstaafl wrote:
Ok, another little thing...
Is there a simple way to use date/time variables in cronjobs? Or do I
need to use a bash script for this? I prefer simple, and just using the
variables directly in the cron command would be easier if it works, so
figured I'd
Ok, some of those variables were wrong (copy pasted from my first
brain-dead attempt)...
I now have a rudimentary bash script with contents:
#!/bin/bash
BACKUP_DIR=/home/user/mypg_backups
PGUSER=superuser
PGtt=`date '+%H:%M'`
PGhr=`date '+%H'`
PGdd=`date '+%a'`
PGmm=`date '+%b'`
PGyy=`date
On Sun, 05 May 2013 14:07:50 -0400, Tanstaafl wrote:
/home/user/mypg_backups/2013/May/Sun/pg_all-13:54.gz: No such file or
directory
So, it is expanding the variables properly, but apparently won't
automatically create the directories? Is there some kind of flag I can
add to the command
On 2013-05-05 2:18 PM, Neil Bothwick n...@digimed.co.uk wrote: On
Sun, 05 May 2013 14:07:50 -0400, Tanstaafl wrote:
/home/user/mypg_backups/2013/May/Sun/pg_all-13:54.gz: No such file or
directory
So, it is expanding the variables properly, but apparently won't
automatically create the
* Tanstaafl tansta...@libertytrek.org [130505 14:32]:
On 2013-05-05 2:18 PM, Neil Bothwick n...@digimed.co.uk wrote: On
Sun, 05 May 2013 14:07:50 -0400, Tanstaafl wrote:
/home/user/mypg_backups/2013/May/Sun/pg_all-13:54.gz: No such file or
directory
So, it is expanding the variables
On 05/05/2013 20:31, Tanstaafl wrote:
On 2013-05-05 2:18 PM, Neil Bothwick n...@digimed.co.uk wrote: On
Sun, 05 May 2013 14:07:50 -0400, Tanstaafl wrote:
/home/user/mypg_backups/2013/May/Sun/pg_all-13:54.gz: No such file or
directory
So, it is expanding the variables properly, but apparently
On Sun, 5 May 2013 16:06:45 -0400, Todd Goodman wrote:
mkdir -p $BACKUP_DIR/$PGyy/$PGmm/$PGdd
/usr/bin/pg_dumpall -U $PGUSER -o | \
gzip $BACKUP_DIR/$PGyy/$PGmm/$PGdd/pg_all-$PGtt.gz
You could have it check first and only do the mkdir if the directory
didn't already exist:
[[ -d
On 2013-05-05 5:25 PM, Neil Bothwick n...@digimed.co.uk wrote:
On Sun, 5 May 2013 16:06:45 -0400, Todd Goodman wrote:
mkdir -p $BACKUP_DIR/$PGyy/$PGmm/$PGdd
/usr/bin/pg_dumpall -U $PGUSER -o | \
gzip $BACKUP_DIR/$PGyy/$PGmm/$PGdd/pg_all-$PGtt.gz
You could have it check first and only
Last question...
In order to keep only a certain number of backups, what would be the
easiest and SAFEST way to delete the older ones?
For example, I want to keep 17 hourlies, and 30 nightlies, so I have two
cron jobs set up, the hourly, and the nightly. Each backs up to a
separate dir.
Am 06.05.2013 01:21, schrieb Tanstaafl:
Last question...
In order to keep only a certain number of backups, what would be the
easiest and SAFEST way to delete the older ones?
For example, I want to keep 17 hourlies, and 30 nightlies, so I have
two cron jobs set up, the hourly, and the
On May 6, 2013 4:57 AM, Tanstaafl tansta...@libertytrek.org wrote:
On 2013-05-05 5:25 PM, Neil Bothwick n...@digimed.co.uk wrote:
On Sun, 5 May 2013 16:06:45 -0400, Todd Goodman wrote:
mkdir -p $BACKUP_DIR/$PGyy/$PGmm/$PGdd
/usr/bin/pg_dumpall -U $PGUSER -o | \
gzip
16 matches
Mail list logo