cron + su <user> /script

view full story

http://www.linuxquestions.org – Hey, i have a script i am trying to run through a cronjob. the problem is, for some reason it cannot be done through cron even though the script runs fine when manually run. Code: /home/axe/hma/hma-start && sleep 20 && su axe /bin/jail & exit 0; hma-start and jail are both shell scripts. jail needs to be run as a specific user, hence 'su <user> /bin/jail'. this script runs fine when manually run. path environment variables are set within the parent script, they are not exported. here are the important snippets of the two other scripts, they work perfectly on t (HowTos)