Quantcast
Channel: linuxadmin: Expanding Linux SysAdmin knowledge
Viewing all articles
Browse latest Browse all 17903

How to run script as another user using their bash profile

$
0
0

I'm working in an environment that uses RHEL/CENTOS 5-7. I'm trying to migrate all crontab entries to rundeck. I'm using SSH to execute the scripts, and I have one user that has rights to sudo as service accounts I've dictated. Now to the question, I'm trying to run a script as an oracle user. I'm having issues with the shortened directory names such as $ORA_DAT being recognized while the script is running. If I was using CLI I would just su - oracle, but that's not an option while running the script through rundeck. Currently I'm running it as this: sudo -u oracle /oracle/local/scripts/refresh_config_files.ksh

What can I do to run this with the variables admins set up in the past?

submitted by I12crash
[link][5 comments]

Viewing all articles
Browse latest Browse all 17903

Trending Articles