Hi Marco,

Sorry if for most of you this looks like a silly or obvious question,
> but I'd be interested to know if it is possible for jstart commands to
> write the output of the files using dates as names, such as
> 2017-03-14.out
>
> My bot runs some scripts daily on some wikis and sometimes fetching
> the entire logs to find things is rather painful. Having daily logs
> would help me with that.


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.

Also, related to this, I'd be interested to know as well if I could
> set a regular cron job to delete these kind of files older than, say,
> one month, so I don't waste too much resources. It'd also be good so I
> could regularly clear the .pywikibot/apicache/* files


We are actively working on https://gerrit.wikimedia.org/r/#/c/326153/ -
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.

Best,



On Tue, Mar 14, 2017 at 4:45 PM, <bwmn.pe...@gmail.com> wrote:

> I don't think it’s possible, although there are some other alternatives.
> According to http://gridscheduler.sourceforge.net/htmlman/
> htmlman1/qsub.html, the following pseudo-environment variables ara
> available to the -o (stdout path) and -e (stderr path) options:
>
>
>
> $HOME       home directory on execution machine
>
> $USER       user ID of job owner
>
> $JOB_ID     current job ID
>
> $JOB_NAME   current job name (see -N option)
>
> $HOSTNAME   name of the execution host
>
> $TASK_ID    array job task index number
>
>
> 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:
>
> -o /data/project/project_name/logs/$JOB_ID.log
>
> See also man jstart.
>
> Kind regards,
> PB
>
>
>
> _______________________________________________
> Labs-l mailing list
> Labs-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/labs-l
>
>


-- 
Madhumitha Viswanathan
Operations Engineer, Wikimedia Labs
_______________________________________________
Labs-l mailing list
Labs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/labs-l

Reply via email to