Gentoo Archives: gentoo-user

From: Tanstaafl <tanstaafl@×××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Script to tar.tgz /etc, works run manually, broken when run from cron
Date: Mon, 31 Mar 2014 12:01:56
Message-Id: 533958FF.4060100@libertytrek.org
In Reply to: Re: [gentoo-user] Script to tar.tgz /etc, works run manually, broken when run from cron by Neil Bothwick
1 On 3/31/2014 7:13 AM, Neil Bothwick <neil@××××××××××.uk> wrote:
2 > On Mon, 31 Mar 2014 07:01:48 -0400, Tanstaafl wrote:
3 >> I have a script that simply performs some backups. The commands are
4 >> like this:
5 >>
6 >> # perform tar.tgz backup of /etc
7 >> tar -czpvf $BKUP_DIR_etc/$BKUP_DateTime-dev-ecat-etc.tgz /etc
8 >>
9 >> When I run this script manually, it does what it is supposed to, and
10 >> the resulting file is about 500K.
11 >>
12 >> When it runs from cron (roots crontab), it results in a 20 byte (empty)
13 >> file.
14 >
15 > You're running tar with -v so it should produce output no matter what it
16 > does. Is that mailed to you? What does it say?
17
18 I don't have these mailed to me, but like I said, it absolutely does
19 produce output - the problem is, when run from cron, the resulting file
20 is only 20 bytes (empty), when I run the exact same script manhually, it
21 produces a file of about 500K that containes the contents of /etc..
22
23 On 3/31/2014 7:27 AM, Helmut Jarausch <jarausch@××××××××××××××××.de> wrote:
24 > perhaps one of $BKUP_DIR_etc or $BKUP_DateTime-dev-ecat-etc
25 > isn't know in that environment
26
27 They are - see above...

Replies

Subject Author
Re: [gentoo-user] Script to tar.tgz /etc, works run manually, broken when run from cron Neil Bothwick <neil@××××××××××.uk>