Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Using date/time variables in cronjobs?
Date: Sun, 05 May 2013 21:25:48
Message-Id: 20130505222531.5cf1612b@digimed.co.uk
In Reply to: Re: [gentoo-user] Using date/time variables in cronjobs? by Todd Goodman
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.

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Using date/time variables in cronjobs? Tanstaafl <tanstaafl@×××××××××××.org>