...
Code Block |
---|
language | bash |
---|
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
The 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.
Code Block |
---|
language | py |
---|
title | $HOME/course/test.py |
---|
|
#!/usr/bin/env python2.7
import os
from ecflow import Defs,Suite,Family,Task,Edit,Trigger,Complete,Event,Meter,Cron
def create_family_house_keeping():
return Family("house_keeping",
Task("clear_log",
Cron("22:30",days_of_week[0])))
print("Creating suite definition")
home = os.path.join(os.getenv("HOME"), "course")
defs = Defs(
Suite("test",
Edit(ECF_INCLUDE=home,ECF_HOME=home),
create_family_house_keeping()))
print(defs)
print("Checking job creation: .ecf -> .job0")
print(defs.check_job_creation())
print("Checking trigger expressions")
errors = defs.check()
assert len(errors) == 0,errors
print("Saving definition to file 'test.def'")
defs.save_as_defs("test.def") |
...