1834499 Members
2393 Online
110068 Solutions
New Discussion

Re: nohup error

 
Neil Wilson_1
Occasional Contributor

nohup error

Can anyone help with the message I keep getting when I try and run a command in a script?

nohup: cannot get $HOME

script command is

/usr/bin/su cduser -c " . /opt/mbnatools/cdirect/mbna_cdirectenv.sh ; nohup /opt/cdirect/cd3300/ndm/bin/cdpmgr -i /opt/cdirect/cd3300/ndm/cfg/cdmbnahp62/initparm.cfg ; sleep 5 "
Think Of Yourself As A Customer
3 REPLIES 3
Neil Wilson_1
Occasional Contributor

Re: nohup error

This can be cancelled. Found the problem that being with the su without the minus. HOME was not set, so set $HOME in env file and exported. Command now works ok and error message no longer evident
Think Of Yourself As A Customer
Magdi KAMAL
Respected Contributor

Re: nohup error

Hi Neil,

It's right what you say.
By the way, if you plan to execute the same script from crontab list, you have to manually execute your own profile file as a first instruction in the crontab script.

Magdi
Ravi_8
Honored Contributor

Re: nohup error

Hi,

#export $HOME and run the script
never give up