Scheduling recurring compute or data transfer tasks on Scientific Computing Linux Clusters

Current active ERIS Cron Servers/nodes:

Start by creating a BASH script that will perform the scheduled task.  The script must setup the environment for any software packages required for it to run. To submit a task to the SciC Linux Clusters scheduler and load software from the "environment modules" repository the following lines must be included:

source /etc/profile.d/

source /etc/profile.d/ 
### if you are using Lmod
#source /etc/profile.d/
#source /etc/profile.d/


Overview of this example:     

  • cron schedules an script ( to run every night at 02:20    
  • the script in turn submits a compute job to the compute cluster to be queued and executed 

This trivial example script submits a compute job to the Scientific Computing (SciC) Linux Clusters. The compute job loads the "anaconda" module and reports the python version. Save this as "": 

source /etc/profile.d/

bsub -q short >/dev/null << EOF

source /etc/profile.d/
### if you are using Lmod
#source /etc/profile.d/
#source /etc/profile.d/

module load anaconda/4.3.1
python --version

Make the script executable and test that it works before creating the scheduled task. Assuming a script named "" in your home folder "/PHShome/abc123" you would test it under an empty environment (the same as the environment it will have when executed by cron) as follows: 

$ chmod +x /PHShome/abc123/  
$ env -i /PHShome/abc123/  

Continue testing the script until it runs successfully under "env -i"


Cron is a Linux tool for scheduling tasks.  Documentation can be found by typing "man 5 crontab" on SciC Linux Clusters, or with a google search for "crontab". 

Cron scheduled tasks are visible only on the node they were created on. All scheduled tasks should be created on the ERIS Cron Servers.
These servers cannot handle compute jobs.

No compute tasks may be performed on ERIS Cron Servers - they must be submitted to the cluster via "bsub" 

Connect to a Cron Server and type "crontab -e" to add an entry to your personal scheduled task list 

$ ssh eris2cron 
$ crontab -e  

This will start the "nano" text editor.  Enter details of the cron job following the crontab syntax and save the file. For example, this content in your crontab will run the script every day at 02:30 

30 2 * * * /PHShome/abc123/  

Exit from the "nano" editor with CTRL + X. If there are any problems with the syntax of the cron job an error message will appear at this time  Finally, exit from the "eris1cron" node 

$ exit  

Any text output or errors will be emailed to you.   

Go to KB0032642 in the IS Service Desk

Related articles