Cron Job and Script for price-update

Abhijit Kshirsagar abhijit86k at gmail.com
Wed Apr 2 08:18:03 EDT 2014


On Tue, Apr 1, 2014 at 6:59 PM, Colin Law <clanlaw at gmail.com> wrote:
> On 1 April 2014 14:02, Abhijit Kshirsagar <abhijit86k at gmail.com> wrote:
 ...
>>
>> So the question is - what is the difference in the cron and ssh instances?
>
> Is it the users crontab or root's?

The user's ...

> Are you changing to the correct directory explicitly in the script?

I'm not changing directory but I am giving full explicit path to the
target file (/home/myname/Documents/Gnucash/Accounts.gnucash). Again,
the same script worked through ssh, so...

> Most likely though it is an environment variable not set as cron does
> not set the full environment.  Google for cron environment to get
> information on this and what to do about it.

Spot on! I looked at the environments - turned out PATH was different
- and cron was running /usr/bin/gnucash whereas I the one I wanted was
/usr/local/bin/gnucash. Since the /local/bin/ version is newer, the
old gnucash was not able to write to the datafile...

Thanks to Colin for spotting that!

Regards,
Abhijit


More information about the gnucash-user mailing list