<div dir="ltr">Hi Marco,<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px">Sorry if for most of you this looks like a silly or obvious question,</span><br style="font-size:12.8px"><span style="font-size:12.8px">but I'd be interested to know if it is possible for jstart commands to</span><br style="font-size:12.8px"><span style="font-size:12.8px">write the output of the files using dates as names, such as</span><br style="font-size:12.8px"><span style="font-size:12.8px">2017-03-14.out</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">My bot runs some scripts daily on some wikis and sometimes fetching</span><br style="font-size:12.8px"><span style="font-size:12.8px">the entire logs to find things is rather painful. Having daily logs</span><br style="font-size:12.8px"><span style="font-size:12.8px">would help me with that.</span></blockquote><div><br></div><div>We don't recommend writing out separate log files by date - this would make any log rotation mechanisms we set up in the future really hard. You could add timestamps to your log messages and grep by date to fetch the relevant logs though.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:12.8px">Also, related to this, I'd be interested to know as well if I could</span><br style="font-size:12.8px"><span style="font-size:12.8px">set a regular cron job to delete these kind of files older than, say,</span><br style="font-size:12.8px"><span style="font-size:12.8px">one month, so I don't waste too much resources. It'd also be good so I</span><br style="font-size:12.8px"><span style="font-size:12.8px">could regularly clear the .pywikibot/apicache/* files</span></blockquote><div><br></div><div>We are actively working on <a href="https://gerrit.wikimedia.org/r/#/c/326153/">https://gerrit.wikimedia.org/r/#/c/326153/</a> - which is still in progress, but will help rotate logs and keep last n weeks of history alone, so we don't have to go in and do manual cleanups every few months. If you would like to be a test tool for this set up, let me know and we can work together and see how it goes. You can reach me @madhuvishy on #wikimedia-labs.</div><div><br></div><div>Best, </div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 14, 2017 at 4:45 PM, <span dir="ltr"><<a href="mailto:bwmn.peter@gmail.com" target="_blank">bwmn.peter@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="ES"><div class="m_-4260150390722631877WordSection1"><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222;background:white">I don't think it’s possible, although there are some other alternatives. According to <a href="http://gridscheduler.sourceforge.net/htmlman/htmlman1/qsub.html" target="_blank">http://gridscheduler.<wbr>sourceforge.net/htmlman/<wbr>htmlman1/qsub.html</a>, the following pseudo-environment variables ara available to the -o (stdout path) and -e (stderr path) options:</span><u></u><u></u></p><div><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222"><u></u> <u></u></span></p></div><div><pre><span style="color:#222222">$HOME home directory on execution machine<u></u><u></u></span></pre><pre><span style="color:#222222">$USER user ID of job owner<u></u><u></u></span></pre><pre><span style="color:#222222">$JOB_ID current job ID<u></u><u></u></span></pre><pre><span style="color:#222222">$JOB_NAME current job name (see -N option)<u></u><u></u></span></pre><pre><span style="color:#222222">$HOSTNAME name of the execution host<u></u><u></u></span></pre><pre><span style="color:#222222">$TASK_ID array job task index number<u></u><u></u></span></pre><p class="MsoNormal"><span style="font-size:12.0pt;font-family:"Arial",sans-serif;color:#222222"><br>You can store these settings in a .jsubrc file located in your home dir (see mine for an example: /data/project/pbbot/.jsubrc) and any future call to jsub/start will parse it if present:<br><br>-o /data/project/project_name/<wbr>logs/$JOB_ID.log<br><br>See also man jstart.<br><br>Kind regards,<br>PB<u></u><u></u></span></p></div><p class="MsoNormal"><u></u> <u></u></p></div></div><br>______________________________<wbr>_________________<br>
Labs-l mailing list<br>
<a href="mailto:Labs-l@lists.wikimedia.org">Labs-l@lists.wikimedia.org</a><br>
<a href="https://lists.wikimedia.org/mailman/listinfo/labs-l" rel="noreferrer" target="_blank">https://lists.wikimedia.org/<wbr>mailman/listinfo/labs-l</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Madhumitha Viswanathan</div><div>Operations Engineer, Wikimedia Labs</div><div dir="ltr"><br></div><div dir="ltr"><br></div></div>
</div></div>