Friday, March 30, 2012

Run the UNIX script on server


I wrote one UNIX script which eventually runs for hours together, which does much functionality fetching the data from DB2 tables and formatting and again loading into another tables. If I run the script in my local system by connecting to the client secured network (VPN) , I can’t guarantee the complete execution of the script.

My friend Maddy suggested me to run the script on server using nohup command in UNIX; here how it is

nohup script.cmd “environment variables” >script.cmd.out 2>&1 &



script.cmd.out file consists the errors and warnings encountered while executing the script.
if yo don't specify the out file name by default nohup.out file will be created in the script path.