RMPR / atbswp

A minimalist macro recorder

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

help to ryn pyc script via crontab if xrdp is installed

AgentZoy opened this issue · comments

Hi Firstly thanks a lot for great instrument
Only one problem I strugling with is
If I have Virtulabox debian 10 + xfce machine I added to cron to run script aoutomaticaly and all working great
*/4 * * * * export DISPLAY=:0 && /usr/bin/python3 /home/alekbotj/Documents/capture.pyc
If I add the same way to same machine running xrdp I got errors
Traceback (most recent call last):
File "/home/ss_monitoring/.local/lib/python3.7/site-packages/Xlib/support/unix_connect.py", line 119, in get_socket
s = _get_unix_socket(address)
File "/home/ss_monitoring/.local/lib/python3.7/site-packages/Xlib/support/unix_connect.py", line 98, in _get_unix_socket
s.connect(address)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/ss_monitoring/.local/lib/python3.7/site-packages/Xlib/support/unix_connect.py", line 123, in get_socket
s = _get_tcp_socket(host, dno)
File "/home/ss_monitoring/.local/lib/python3.7/site-packages/Xlib/support/unix_connect.py", line 93, in _get_tcp_socket
s.connect((host, 6000 + dno))
ConnectionRefusedError: [Errno 111] Connection refused

If I run it via terminal all is ok

Can someone help how to fix this issue?

I read it before but nothing helped me Cant understand why on one debian machine via cron all works correctly but for same remote machine not I tried solutions from thread but not sucessfull

So I understand that for cron need something env DISPLAY=:0 befre patch to pyc script
If I understood I need to get somehow variable correct value But I dont know how to do it If I connected via xrdp session to remote machine (RDP emulator) And without cron all works perfectly ))

printenv solved my problem