<div dir="ltr">Dear Sir/Madam:<div><br></div><div>I would like to auto-run a bash script using crontab on a linux HPC.</div><div>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!</div><div>Regards</div><div>Ed</div><div> #!/bin/bash<br>module load NCL/6.4.0-GCC-7.1.0<br>NCARG_ROOT=/opt/nesi/CS500_centos7_skl/NCL/6.4.0-GCC-7.1.0<br>export NCARG_ROOT<br>PATH=$PATH:/opt/nesi/CS500_centos7_skl/NCL/6.4.0-GCC-7.1.0<br>export PATH<br>cd /home/yangy/NZLAM4_READ_STA/STATION_LW_SW<br>#dir="$(date -d "1 day ago" +'%Y%m%d')"<br>dir="$(date +'%Y%m%d')"<br>echo "$dir"<br>[ ! -d $dir ] && mkdir $dir<br>#cp * $dir<br>cd /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW/$dir<br>rm *.nc *.dat<br>cd /niwa/oper/ecox_oper/cylc-run/nzlam_4km/share/cycle/"$dir"T12/member_1/output<br>cp escape*.nc /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW/$dir<br>cd /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW<br>cp read_STA_LW_12.ncl /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW/"$dir"<br>cd /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW/"$dir"<br>ncl /nesi/project/niwa00004/yangy/NZLAM4_READ_STA/STATION_LW_SW/"$dir"/read_STA_LW_12.ncl<br></div></div>