Workload Automation

example of how you can use the "profile" attribute of job defination. 

Dec 24, 2015 08:27 AM

* ----------------- TEST1 ----------------- */

insert_job: TEST1 job_type: CMD
command: "alias > /home/sample/alias.txt"
machine: mymachine
owner: user1
permission:
date_conditions: 0
std_out_file: /home/log/${AUTO_JOB_NAME}_${AUTORUN}.log
std_err_file: /home/log/${AUTO_JOB_NAME}_${AUTORUN}.err
alarm_if_fail: 0
profile: /home/conf/.profile

- This is  extraction from the .profile of user 'user1'

...
alias lm='ls -al | more'
alias ll='ls -l'
alias la='ls -la'
alias lrt='ls -alrt'
...

- extraction from agentparm.txt

# this tells the agent to switch to the user home
oscomponent.initialworkingdirectory=USER
#these are required to prevent the sourcing of the user's login profile
oscomponent.profiles.src.delay=true
oscomponent.profiles.global.override=true
# do not source $HOME/.profile
#oscomponent.noforceprofile=true

- The result after run the job

root:  vi  /home/sample/alias.txt
...
la='ls -la'
ll='ls -l'
lm='ls -al | more'
lrt='ls -alrt'
....


Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Related Entries and Links

No Related Resource entered.