[ncl-talk] how to use crontab to run a ncl job

Ehsan Taghizadeh ehsantaghizadeh at yahoo.com
Fri Sep 18 04:33:30 MDT 2020


 Dear Yang,I think add following lines above the bash file could solve the problem, if doesn't let me know:
export NCARG_ROOT=/usr/local/ncl6.6export PATH=$PATH:$NCARG_ROOT/bin
which highlighted lines should be edited based on your ncl path.
SincerelyEhsan     On Friday, September 18, 2020, 04:25:17 AM GMT+4:30, yang yang via ncl-talk <ncl-talk at mailman.ucar.edu> wrote:  
 
 Dear Sir/Madam:
I would like to auto-run a bash script using crontab on a linux HPC.The bash script looks as below. Only the ncl job cannot be done. However, if I run it manually, it can be run without any problem. Can you please tell me how to make the right setting so that my bash script can be run successfully using crontab? Thank you very much!RegardsEd #!/bin/bash
module load NCL/6.4.0-GCC-7.1.0
NCARG_ROOT=/opt/nesi/CS500_centos7_skl/NCL/6.4.0-GCC-7.1.0
export NCARG_ROOT
PATH=$PATH:/opt/nesi/CS500_centos7_skl/NCL/6.4.0-GCC-7.1.0
export PATH
cd /home/yangy/NZLAM4_READ_STA/STATION_LW_SW
#dir="$(date -d "1 day ago" +'%Y%m%d')"
dir="$(date +'%Y%m%d')"
echo "$dir"
[ ! -d $dir ] && mkdir $dir
#cp * $dir
cd /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW/$dir
rm *.nc *.dat
cd /niwa/oper/ecox_oper/cylc-run/nzlam_4km/share/cycle/"$dir"T12/member_1/output
cp escape*.nc /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW/$dir
cd /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW
cp read_STA_LW_12.ncl /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW/"$dir"
cd /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW/"$dir"
ncl /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW/"$dir"/read_STA_LW_12.ncl
_______________________________________________
ncl-talk mailing list
ncl-talk at mailman.ucar.edu
List instructions, subscriber options, unsubscribe:
https://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200918/ce579501/attachment.html>


More information about the ncl-talk mailing list