If you need to run a certain task at given regular intervals automatically, you may use our cron service avaiable available on the hosts hpc-cron for HPC users and ecs-cron for those with no access to the HPCF.
Note | ||
---|---|---|
| ||
Do not run your crontabs on any host other than "hpc-cron" or "ecs-cron", as they may disappear at any point after a reboot or maintenance session. The only guaranteed nodes are hpc-cron and ecs-cron. |
...
You can see your cron jobs by logging into hpc-cron or ecs-cron via ssh:
No Format |
---|
ssh hpc-logincron # or for users with no HPCF access: ssh ecs-logincron |
Once logged inAnd once inside, run:
No Format |
---|
crontab -l |
...
You can edit your crontab by running using the following command on the hpc-cron or ecs-cron special nodes:
...
No Format |
---|
03 10,22 1 * * /path/to/my_script.sh |
would execute /path/to/my_script.sh on the first day of every month, at 10:03 and 22:03. You may check man 5 crontab
for all the details on the syntax and possible options to customise your cron jobs.
Note | ||
---|---|---|
| ||
Cron tasks run with a very limited user environment. No user profile will be sourced by cron to run before running your task. Unless the task is very lightweight, please consider running your cron tasks through batch as described below In particular, the $SCRATCH environment variable IS NOT SET. If you need to use $SCRATCH in your cron job then please specify the actual path to your $SCRATCH (i.e., /scratch/...) and DO NOT USE the environment variable ! |
Running your cron tasks through batch
...
If you need to run a logserver on the Atos HPCF, it is a good idea to have a cron job that checks if the server is up and restarts it automatically otherwise. Because the log server runs on a different node, you would need to run it remotely. The following example runs every 15 minutes to make a connection to hpc-log to start the logserver:
...