...
Horizontal Navigation Bar | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
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.
This will be done with cron attribute introduced in the previous page. A cron will run indefinitely. i.e. once it has completed it will automatically re-queue itself.
For more examples of adding a cron see the user manual and ecFlow Python Api
Ecf Script
...
Code Block | ||||
---|---|---|---|---|
| ||||
%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
- Make the changes to the suite definition file
- Create all the necessary ecf script‘s
- Replace the suite
python: python3 test.py; python3 client.py
text: ecflow_client --suspend=/test ; ecflow_client --replace=/test test.def - ecflow_ui has a special window to explain why a task is queued. Select a queued task and press the icon
or click on the 'Why tab' - Manually run the task. Examine the log file on disk.
Horizontal Navigation Bar | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|