I'm afraid you have to create a small wrapper script, activate venv in it
and run that shell script from crontab.

Martin

Ășt 25. pro 2018 0:30 odesĂ­latel Jay prakash <0freerunn...@gmail.com> napsal:

> Hello, I am getting the following problem on the test. I have installed
> the module in venv as per
> https://wikitech.wikimedia.org/wiki/Help:Toolforge/Web#python_(Python3_+_Kubernetes).
> and I have also test
>
> /data/project/jayprakashbot/www/python/venv/bin/python instread of python
> in cron file. same result
>
>
> ```error
>
> @tools-bastion-03:~$ cat cron-29.err
>
> Traceback (most recent call last):
>
>   File "/data/project/jayprakashbot/www/python/src/gen_stats.py", line 2,
> in <module>
>
>     import toolforge
>
> ImportError: No module named 'toolforge'
>
> ```
>
> On Tue, Dec 25, 2018 at 3:30 AM Giovanni Tirloni <gtirl...@wikimedia.org>
> wrote:
>
>> On 12/24/18 7:50 PM, Jay prakash wrote:
>> > Hello,
>> >          I want to set up a cron job for my tool on tools forge.
>> >
>> >  From (venv) tools.indic-wsstats@tools-bastion-03:$
>> > ```
>> > 1. $ crontab -e
>> > 2. paste the 0 */6 * * * python
>> > /data/project/indic-wsstats/www/python/src/gen_stats.py
>> > 3. Ctrl O as default name like (tmp/XX)
>> > 4. Ctrl X
>> > ```
>> > Is this enough? Am I missing something?
>>
>> Hello,
>>
>>   That should be it. You can read more about it here:
>>
>>
>> https://wikitech.wikimedia.org/wiki/Help:Toolforge/Grid#Creating_a_crontab
>>
>>   And here's a handy tool if you need help figuring out the schedule:
>>
>>    https://crontab-generator.org
>>
>> Regards,
>>
>>
>> --
>> Giovanni Tirloni
>> Operations Engineer
>> Wikimedia Cloud Services
>>
>> _______________________________________________
>> Wikimedia Cloud Services mailing list
>> Cloud@lists.wikimedia.org (formerly lab...@lists.wikimedia.org)
>> https://lists.wikimedia.org/mailman/listinfo/cloud
>
> _______________________________________________
> Wikimedia Cloud Services mailing list
> Cloud@lists.wikimedia.org (formerly lab...@lists.wikimedia.org)
> https://lists.wikimedia.org/mailman/listinfo/cloud
_______________________________________________
Wikimedia Cloud Services mailing list
Cloud@lists.wikimedia.org (formerly lab...@lists.wikimedia.org)
https://lists.wikimedia.org/mailman/listinfo/cloud

Reply via email to