On 31/03/2014 13:01, 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?
> 
> 

It's almost always the same two things that cause this:

1. cron doesn't give you an environment so there's no $PATH. Other
posters covered this nicely.

2. I had this one just last week in fact - pwd is not what you think it
is. In cron it ends up being / so the solution was again to use full
paths. In my case, I had a config file listed on the command line.



-- 
Alan McKinnon
[email protected]


Reply via email to