Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Horizontal Navigation Bar


Button Group

Button Hyperlink
titlePrevious
typestandard
urlhttps://confluence.ecmwf.int/display/ECFLOW/Time+Triggers
Button Hyperlink
titleUp
typestandard
urlhttps://softwareconfluence.ecmwf.int/wiki/display/ECFLOW/Going+Further
Button Hyperlink
titleNext
typestandard
urlhttps://confluence.ecmwf.int/display/ECFLOW/Labels


...

This log file will grow over time to a considerable size.

In this exercise, we will create a task, whose job is to periodically back up and clear this log file.

...

For more examples of adding a cron see the user manual and ecFlow Python Api

Ecf Script

...

Code Block
languagebash
title$HOME/course/test/house_keeping/clear_log.ecf
%include <head.h>

# copy the log file to the ECF_HOME/log directory
cp %ECF_LOG% %ECF_HOME%/log/.
 
# clear the log file
ecflow_client  --log=clear

%include <tail.h>

 Text

For brevity, the previous families have been omitted.

Code Block
# Definition of the suite test.
suite test
 edit ECF_INCLUDE "$HOME/course"    # replace '$HOME' with the path to your home directory
 edit ECF_HOME    "$HOME/course"
 family house_keeping
     task clear_log
       cron -w 0 22:30  # run every Sunday at 10:30pm
 endfamily
endsuite

Python

For brevity, the previous families have been omitted.

...

What to do

  1. Make the changes to the suite definition file
  2. Create all the necessary ecf script‘s 
  3. Replace the suite
    python:  python3 test.py; python3 client.py
    text:       ecflow_client --suspend=/test  ;  ecflow_client --replace=/test  test.def
  4. ecflow_ui  has a special window to explain why a task is queued. Select a queued task and  click on the 'Why tab'
  5. Manually run the task. Examine the log file on disk.

Horizontal Navigation Bar


Button Group

Button Hyperlink
titlePrevious
typestandard
urlhttps://confluence.ecmwf.int/display/ECFLOW/Time+Triggers
Button Hyperlink
titleUp
typestandard
urlhttps://softwareconfluence.ecmwf.int/wiki/display/ECFLOW/Going+Further
Button Hyperlink
titleNext
typestandard
urlhttps://confluence.ecmwf.int/display/ECFLOW/Labels


...