- I have users
root
anduser1
- All of my python scripts have been
created by
user1
- I have created a bash file that needs to be automated. The bash file calls my python scripts
- I have added my bash call to the cron file
However, my python environment for root
is not the same as it is for user1
(different versions, library packages, etc, etc). So when the cron kicks off, it gives me python errors like "library not found" because the root
environment is being used.
How can I ensure that my cron commands run my python scripts under the user1
python environment and not root
?
Note that I've already tried using some variation of su
in my cron file but it always asks for a password and I need this to be a fully automated process.