running batch jobs via Linux cron

Get help for specific problems
Posts: 7
Joined: 4 Jun 2019

Post by JohnHaggerty • 14 Aug 2019, 14:02

Hi folks,

I have a script which runs various FFS batch jobs without a problem when initiated from a Linux Mint Terminal window. However, when initiated by cron all the FFS batch jobs fail -
Error: Unable to initialize GTK+, is DISPLAY set properly?

***** Sorted *****
I ran env in Terminal and compared it with running env in the cron job. I then added the following Terminal env variables to the crontab entry:

Although it's nothing to do with FFS I also got 'No volume for device file' errors when running 'gio mount -d' commands.
Adding the following Terminal env variable to the crontab entry fixed it:



P.S. I wish I'd searched the Forum on 'cron' rather than 'gtk', then I'd have found out without having to experiment for myself that I only needed the DISPLAY=:0 variable. I've since removed the GTK_ variables with no problems.