[ncl-talk] how to use crontab to run a ncl job
yang yang
yang.yang816 at gmail.com
Sun Sep 20 16:24:26 MDT 2020
Hi Ehsan:
Thanks very much for your help!
I tried a few times and found it works after I have added the following in
my script.
source /etc/profile >/dev/null 2>&1
source $HOME/.profile
Cheers!
Ed
On Fri, Sep 18, 2020 at 10:33 PM Ehsan Taghizadeh via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:
> 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.6
> export PATH=$PATH:$NCARG_ROOT/bin
>
> which highlighted lines should be edited based on your ncl path.
>
> Sincerely
> Ehsan
> 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!
> Regards
> Ed
> #!/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
> _______________________________________________
> 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/20200921/ed00ec4c/attachment.html>
More information about the ncl-talk
mailing list