I have an alias in my .bashrc file that runs an executable python file like so:
alias my-command="sudo -u apache /path/to/file.py"
When I run my-command
It prompts for my sudo password and then it runs the .py file.
However the python script writes to a Log file that only apache has permission to write to. When I run my-command
it says Permission denied
when it tries to write to that file.
When I run sudo -u apache /path/to/file.py
directly the script runs fine.
What am I doing wrong here? Would it be better to change my alias to:
my-command="/path/to/file.py"
and then run:
sudo -u apache my-command