<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Respected Sir,<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; My project is batch processing in GRASS GIS.I need to execute the mapset created automatically in every 1hrs.I tried it using sleep,but it is better to use cron is the suggestion.No idea about how to use cron in batch processing.Give me some guideliness of cron with example and reference ,how to use it in batch processing.Batch processing script is below<br>&nbsp; #!/bin/sh<br><br># the file contains the GRASS variables which define the LOCATION etc.<br>echo "GISDBASE=/root/weath<br>LOCATION_NAME=kerala<br>MAPSET=temperature<br>GRASS_DB_ENCODING=utf-8<br>MONITOR=x2<br>GRASS_GUI=text"<br>&nbsp;<br><br><br># use process ID (PID) as lock file number:<br>export GIS_LOCK=$$<br><br><br>##### the algorithms goes
 here<br><br>error_routine () {<br>&nbsp;echo "ERROR: $1"<br>&nbsp;exit 1<br>}<br>echo "&nbsp; GRASS_BATCH_JOB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; shell script to be processed as batch job"<br>if [ -n "$GRASS_BATCH_JOB" ] ; then<br>&nbsp;&nbsp; # defined, but ...<br>&nbsp;&nbsp; if [ ! -f "$GRASS_BATCH_JOB" ] ; then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # wrong file<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "Job file '$GRASS_BATCH_JOB' has been defined in the 'GRASS_BATCH_JOB' variable but not found. Exiting."<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "Use 'unset GRASS_BATCH_JOB' to disable batch job processing."<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit 1<br>&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # right file, but ...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [ ! -x "$GRASS_BATCH_JOB" ] ; then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "Please change file permission to 'executable' for
 '$GRASS_BATCH_JOB'"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exit 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo "Executing '$GRASS_BATCH_JOB' ..."<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SHELL="$GRASS_BATCH_JOB"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi<br>&nbsp;&nbsp; fi<br>fi<br><br><br># set region to default settings <br>g.region n=12:47:21.1074N s=8:18:00.2682N w=74:52:26.4E e=77:16:58.8E || error_routine "g.region"<br><br><br>#connection to database<br>db.connect driver=mysql database="project"<br><br>db.login driver=mysql database=project user=root password=1234<br>db.connect -p<br>db.tables -p<br><br>for n in {0..1}<br>do<br>#import Vector map<br>v.in.db driver=mysql database=project table=rain x=lon_dd y=lat_dd output=tempera --o key=st_code || error_routine "v.in.db"<br>d.mon start=x0 || error_routine "d.mon"<br>d.vect tempera || error_routine "d.vect"<br>sleep
 5;<br><br>#import Raster map<br>v.to.rast input=tempera output=tempera1 --o use=attr column=rain_fall || error_routine "v.to.rast"<br>d.mon start=x1|| error_routine "d.mon"<br>d.rast tempera1 || error_routine "d.rast"<br>sleep 7;<br>#show classified interpolated map:<br><br>r.surf.idw input=tempera1 output=tempera2 --o || error_routine "r.surf.idw"<br>d.mon start=x2 || error_routine "d.mon"<br>d.rast tempera2 || error_routine "d.rast"<br>sleep 8;<br><br><br># close PNG output<br>d.mon stop=x0&nbsp; || error_routine "d.mon stop"<br>d.mon stop=x1&nbsp; || error_routine "d.mon stop"<br>d.mon stop=x2&nbsp; || error_routine "d.mon stop"<br>sleep 3600;<br>done<br># remove internal tmp stuff:<br>$GISBASE/etc/clean_temp&nbsp; || error_routine "clean_temp"<br>rm -rf $TMPDIR/grass6-$USER-$GIS_LOCK<br><br># done.<br>echo "Generated "<br><br>rm -rf "$tmp"&nbsp; # remove session files from tmpdir<br><br>echo "done"<br>echo<br>echo<br>echo<br>echo "Goodbye from GRASS
 GIS"<br>echo<br>if [ -x "$GRASS_BATCH_JOB" ] ; then<br>&nbsp;&nbsp; echo "Batch job '$GRASS_BATCH_JOB' (defined in GRASS_BATCH_JOB variable) was executed."<br>&nbsp;&nbsp; exit 0<br>fi<br><br><br>Please notify where to use cron and how to set the time intervals that will automatically execute every 1 hr.<br><br>Thank You<br><br>With Regards<br><br><br></td></tr></table><br>