Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
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 11:14:06
Message-Id: 20140331121353.5c6ea65e@hactar.digimed.co.uk
In Reply to: [gentoo-user] Script to tar.tgz /etc, works run manually, broken when run from cron by Tanstaafl
1 On Mon, 31 Mar 2014 07:01:48 -0400, Tanstaafl wrote:
2
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 You could add "set -x" at the start of the script for an even more
19 verbose report.
20
21
22 --
23 Neil Bothwick
24
25 Did you know that eskimos have 17 different words for linguist?

Attachments

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

Replies

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