Jorge Vega Sánchez
Jorge Vega Sánchez

Reputation: 7590

Not execution of shell script with nohup

I have a problem executing a shell script with the "modifier" nohup. The script executed without nohup works fine.

The script have all the rights. And the error message is really weird.

oracle@serveur6:/home/oracle/xxx/yyy/test>ls -ltr
total 16
-rwxrwxrwx    1 oracle   dba            1620 Jun  7 14:56 lanceur2.sql
-rwxrwxrwx    1 oracle   dba              48 Jun  7 14:56 alt_script.ksh
drwxrwxrwx    2 oracle   dba             256 Jun  7 14:57 log

oracle@serveur6:/home/oracle/xxx/yyy/test> nohup /home/oracle/admin/ESPACE/test/alt_script.ksh &
[1]     25493628
oracle@clay925p6:/home/oracle/admin/ESPACE/test> Sending output to nohup.out
nohup: /home/oracle/admin/ESPACE/test/alt_script.ksh: **No such file or directory**

[1] +  Done(127)               nohup /home/oracle/admin/ESPACE/test/alt_script.ksh &

Upvotes: 1

Views: 1306

Answers (1)

Devolus
Devolus

Reputation: 22094

Things to check:

  1. The path to the script is correct.
  2. The script has executable permission set.
  3. the first line of the script contains something like #!/bin/sh

nohup runs a command in the background, thus the script must be executable like any other command.

Upvotes: 1

Related Questions