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 $BACKUP_DIR/$PGyy/$PGmm/$PGdd ]] || \
>         mkdir -p $BACKUP_DIR/$PGyy/$PGmm/$PGdd

You could, but it is redundant as mkdir already does that test when
invoked with -p.


-- 
Neil Bothwick

Never argue with an idiot. First, they bring you down to their level.
Then they beat you with experience.

Attachment: signature.asc
Description: PGP signature

Reply via email to