Gentoo Archives: gentoo-user

From: Tanstaafl <tanstaafl@×××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Using date/time variables in cronjobs?
Date: Sun, 05 May 2013 17:32:45
Message-Id: 51869795.4080607@libertytrek.org
In Reply to: Re: [gentoo-user] Using date/time variables in cronjobs? by Mick
1 On 2013-05-05 1:07 PM, Mick <michaelkintzios@×××××.com> wrote:
2 > On Sunday 05 May 2013 17:56:33 Tanstaafl wrote:
3 >> Ok, another little thing...
4 >>
5 >> Is there a simple way to use date/time variables in cronjobs? Or do I
6 >> need to use a bash script for this? I prefer simple, and just using the
7 >> variables directly in the cron command would be easier if it works, so
8 >> figured I'd ask first...
9 >>
10 >> I'm trying to schedule a dump of my databases like so:
11 >>
12 >> pg_dumpall --username=username -o -f
13 >> /home/user/mypg_backups/hourly/\%y/\%m/\%d/\%t.sql.gz
14 >>
15 >> But trying to run this command fails with:
16 >>
17 >> pg_dumpall: could not open the output file
18 >> "/home/user/mypg_backups/hourly/%y/%m/%d/%t.sql.gz": No such file or
19 >> directory
20 >>
21 >> Tried escaping the variables and not, same error...
22 >
23 > Is it perhaps a matter of the process having write access?
24
25 No, it is running as root...