[meta]
    title = family failure cleanup task example number 1

    description = """
Illustrates use of a special task to clean up failed tasks. Here the
cleanup task runs whether or not the family fails, but it only cleans up
if necessary. See also family failure cleanup task example number 2, and
the AutoRecover examples for recovery tasks that only run if needed."""

[scheduling]
    initial cycle point = 20110101T06
    final cycle point = 20110102T00
    [[dependencies]]
        [[[T00, T06, T12, T18]]]
            graph =  """
                a => FAM
                a[-PT6H] => a
                FAM:finish-all & FAM:succeed-any => b
                FAM:finish-all & FAM:succeed-any => fam_cleanup"""
[runtime]
    [[a]]
    [[b]]
    [[FAM]]
    [[m_foo]]
        inherit = FAM
        script = sleep 8
    [[m_bar]]
        inherit = FAM
        script = """
# Fail at 6,18, succeed at 0,12:
HH=$( cylc cycle-point --print-hour )
if (( HH == 06 || HH == 18 )); then
    COMMAND=/bin/false
else
    COMMAND=/bin/true
fi
sleep 5
$COMMAND"""
    [[m_baz]]
        inherit = FAM
        script = sleep 10
    [[fam_cleanup]]
        script = fam_cleanup.sh
        [[[meta]]]
            description = "this is a family failed task cleanup task"

