1 |
On Sun, 5 May 2013 16:06:45 -0400, Todd Goodman wrote: |
2 |
|
3 |
> mkdir -p $BACKUP_DIR/$PGyy/$PGmm/$PGdd |
4 |
> /usr/bin/pg_dumpall -U $PGUSER -o | \ |
5 |
> gzip >$BACKUP_DIR/$PGyy/$PGmm/$PGdd/pg_all-$PGtt.gz |
6 |
> |
7 |
> You could have it check first and only do the mkdir if the directory |
8 |
> didn't already exist: |
9 |
> |
10 |
> [[ -d $BACKUP_DIR/$PGyy/$PGmm/$PGdd ]] || \ |
11 |
> mkdir -p $BACKUP_DIR/$PGyy/$PGmm/$PGdd |
12 |
|
13 |
You could, but it is redundant as mkdir already does that test when |
14 |
invoked with -p. |
15 |
|
16 |
|
17 |
-- |
18 |
Neil Bothwick |
19 |
|
20 |
Never argue with an idiot. First, they bring you down to their level. |
21 |
Then they beat you with experience. |