In this post, I will teach you a few things to run any executable file in Linux in the background using redirection. I have specified the steps with examples as mentioned below:
STEPS:
1. Create a sample file (eg: )
- command : vi <file1>.sh
- example : vi startadmin.sh
2. Add the following lines and save the file :
- command : nohup ./<PATH>/<execution_file>.sh >> /<PATH>/file1.out 2>&1 &
- example : nohup ./home/oracle/bin/startWebLogic.sh >> /home/oracle/AdminServer.out 2>&1 &
3. Give the permission to the newly created file
- command : chmod 775 <file1>.sh
- example : chmod 775 startadmin.sh
This method can be used to run file such as starting Admin Server in Weblogic example, startWebLogic.sh.
But be sure to follow the below guidelines to ensure this trick works.
- define the correct path of the execution file and the out file.
- give the appropriate permission
0 comments