[GRASSLIST:1463] Re: Initialising Grass Script From cron

Markus Neteler neteler at geog.uni-hannover.de
Thu Feb 15 10:21:06 EST 2001

On Thu, Feb 15, 2001 at 03:56:26PM +0200, Izak Thomas Henry Deyzel wrote:
> Good Day Everyone,
> I am using Grass4.2.1. I am trying to automise my whole process of data
> manipulation and map production. I am using a bash script to do the
> grass stuff, but need to intialise this script from a cron. Grass and
> its dbase is running the whole time, but the cron runs in its own
> environment oblivious of Grass dbase. I test for the db being active and
> receive errors. Is there a method of exporting Grass' environmental
> variables so that my cron environment will be aware of the dbase or is
> there a method of intialising Grass and its dbase within the cron
> script: 
> e.g. grass4.2 <<-script 
> .....grass stuff.... 
> exit 
> script
> Thank you.
Hi Izak,

you may have a look here:

    How to use GRASS in batch mode (fully script based)?:

This has been simplified in GRASS 5:

grass5 -help
    grass5 [-h | -help | --help] [-text | -tcltk] [[[<GISDBASE>/]<LOCATION_NAME>/]<MAPSET>]

    -h or -help or --help          print this help message
    -text                          use text based interface
    -tcltk                         use Tcl/Tk based graphical interface

    GISDBASE                       initial database
    LOCATION_NAME                  initial location
    MAPSET                         initial mapset

    GISDBASE/LOCATION_NAME/MAPSET  fully qualified initial LOCATION directory

Environment variables:
    GRASS_TCLSH                    set tclsh shell name to override 'tclsh'
    GRASS_WISH                     set wish shell name to override 'wish'

Hope this helps,

 Markus Neteler

More information about the grass-user mailing list