On 03/31/2014 01:01:48 PM, Tanstaafl wrote:
Hi all,
Ok, this is really irritating me...
I have a script that simply performs some backups. The commands are
like this:
# perform tar.tgz backup of /etc
tar -czpvf $BKUP_DIR_etc/$BKUP_DateTime-dev-ecat-etc.tgz /etc
When I run this script manually, it does what it is supposed to, and
the resulting file is about 500K.
When it runs from cron (roots crontab), it results in a 20 byte
(empty) file.
So what am I missing/doing wrong?
This is what I do when debugging such things
put
echo $BKUP_DIR_etc/$BKUP_DateTime-dev-ecat-etc.tgz >/tmp/cron.LOG
into an executable script and run it with
at now+1minute
and check /tmp/cron.LOG
perhaps one of $BKUP_DIR_etc or $BKUP_DateTime-dev-ecat-etc
isn't know in that environment
Helmut