Cron Tab as specific user and python virtual env

switch to that user.

sudo su - xfeautomation

Run

crontab -e

A file editor with empty file will appear. Add your job without user name there and save it.

0 * * * * /opt/scripts/wf_venv/bin/python /opt/scripts/wf_api_linux.py 2>&l /opt/scripts/log.txt

Verification:

sudo su - xfeautomation crontab -l

OR

sudo crontab -u xfeautomation