<span class="target" id="index-0"></span><div class="section" id="back-archiving-solution">
<span id="back-archiving-soln"></span>
<p>One possible Solution:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="c">#!/usr/bin/env python2.5</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">import</span> <span class="nn">ecflow</span>
<span class="n">defs</span> <span class="o">=</span> <span class="n">ecflow</span><span class="o">.</span><span class="n">Defs</span><span class="p">(</span><span class="s">"back_archiving.def"</span><span class="p">)</span>
<span class="n">suite</span> <span class="o">=</span> <span class="n">defs</span><span class="o">.</span><span class="n">add_suite</span><span class="p">(</span><span class="s">"back_archiving"</span><span class="p">)</span>
<span class="n">suite</span><span class="o">.</span><span class="n">add_repeat</span><span class="p">(</span> <span class="n">ecflow</span><span class="o">.</span><span class="n">RepeatDay</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">)</span>
<span class="n">suite</span><span class="o">.</span><span class="n">add_variable</span><span class="p">(</span><span class="s">"ECF_HOME"</span><span class="p">,</span><span class="n">os</span><span class="o">.</span><span class="n">getenv</span><span class="p">(</span><span class="s">"HOME"</span><span class="p">)</span> <span class="o">+</span> <span class="s">"/course"</span><span class="p">)</span>
<span class="n">suite</span><span class="o">.</span><span class="n">add_variable</span><span class="p">(</span><span class="s">"ECF_INCLUDE"</span><span class="p">,</span><span class="n">os</span><span class="o">.</span><span class="n">getenv</span><span class="p">(</span><span class="s">"HOME"</span><span class="p">)</span> <span class="o">+</span> <span class="s">"/course"</span><span class="p">)</span>
<span class="n">suite</span><span class="o">.</span><span class="n">add_variable</span><span class="p">(</span><span class="s">"ECF_FILES"</span><span class="p">,</span><span class="n">os</span><span class="o">.</span><span class="n">getenv</span><span class="p">(</span><span class="s">"HOME"</span><span class="p">)</span> <span class="o">+</span> <span class="s">"/course/back"</span><span class="p">)</span>
<span class="n">suite</span><span class="o">.</span><span class="n">add_variable</span><span class="p">(</span><span class="s">"SLEEP"</span><span class="p">,</span><span class="s">"2"</span><span class="p">)</span>
<span class="n">suite</span><span class="o">.</span><span class="n">add_limit</span><span class="p">(</span><span class="s">"access"</span><span class="p">,</span><span class="mi">2</span><span class="p">)</span>
<span class="k">for</span> <span class="n">kind</span> <span class="ow">in</span> <span class="p">(</span> <span class="s">"analysis"</span><span class="p">,</span> <span class="s">"forecast"</span><span class="p">,</span> <span class="s">"climatology"</span><span class="p">,</span> <span class="s">"observations"</span><span class="p">,</span> <span class="s">"images"</span> <span class="p">):</span>
<span class="n">find_fam</span> <span class="o">=</span> <span class="n">suite</span><span class="o">.</span><span class="n">add_family</span><span class="p">(</span><span class="n">kind</span><span class="p">);</span>
<span class="n">find_fam</span><span class="o">.</span><span class="n">add_repeat</span><span class="p">(</span> <span class="n">ecflow</span><span class="o">.</span><span class="n">RepeatDate</span><span class="p">(</span><span class="s">"DATE"</span><span class="p">,</span><span class="mi">19900101</span><span class="p">,</span><span class="mi">19950712</span><span class="p">)</span> <span class="p">);</span>
<span class="n">find_fam</span><span class="o">.</span><span class="n">add_variable</span><span class="p">(</span><span class="s">"KIND"</span><span class="p">,</span><span class="n">kind</span><span class="p">)</span>
<span class="n">find_fam</span><span class="o">.</span><span class="n">add_task</span><span class="p">(</span><span class="s">"get_old"</span><span class="p">)</span><span class="o">.</span><span class="n">add_inlimit</span><span class="p">(</span><span class="s">"access"</span><span class="p">)</span>
<span class="n">find_fam</span><span class="o">.</span><span class="n">add_task</span><span class="p">(</span><span class="s">"convert"</span><span class="p">)</span><span class="o">.</span><span class="n">add_trigger</span><span class="p">(</span><span class="s">"get_old == complete"</span><span class="p">)</span>
<span class="n">find_fam</span><span class="o">.</span><span class="n">add_task</span><span class="p">(</span><span class="s">"save_new"</span><span class="p">)</span><span class="o">.</span><span class="n">add_trigger</span><span class="p">(</span><span class="s">"convert == complete"</span><span class="p">)</span>
</pre></div>
</div>
</div>
|