Gentoo Archives: gentoo-user

From: Tanstaafl <tanstaafl@×××××××××××.org>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Using date/time variables in cronjobs?
Date: Sun, 05 May 2013 16:57:08
Message-Id: 51868F41.6050407@libertytrek.org
1 Ok, another little thing...
2
3 Is there a simple way to use date/time variables in cronjobs? Or do I
4 need to use a bash script for this? I prefer simple, and just using the
5 variables directly in the cron command would be easier if it works, so
6 figured I'd ask first...
7
8 I'm trying to schedule a dump of my databases like so:
9
10 pg_dumpall --username=username -o -f
11 /home/user/mypg_backups/hourly/\%y/\%m/\%d/\%t.sql.gz
12
13 But trying to run this command fails with:
14
15 pg_dumpall: could not open the output file
16 "/home/user/mypg_backups/hourly/%y/%m/%d/%t.sql.gz": No such file or
17 directory
18
19 Tried escaping the variables and not, same error...

Replies

Subject Author
Re: [gentoo-user] Using date/time variables in cronjobs? Mick <michaelkintzios@×××××.com>
Re: [gentoo-user] Using date/time variables in cronjobs? Alan McKinnon <alan.mckinnon@×××××.com>
Re: [gentoo-user] Using date/time variables in cronjobs? Tanstaafl <tanstaafl@×××××××××××.org>