Operating System - HP-UX
1833758 Members
2396 Online
110063 Solutions
New Discussion

nohup: ... No such file or directory

 
Ahmed_58
Regular Advisor

nohup: ... No such file or directory

Hi to all,
I encountered first time the 'No such file or directory' or 'File not found' !! as shown on below screen images.

-----------------------------------------------
$ls -ltr B*
-rwxrwx--- 1 tbmsbill tbms 462 Dec 20 12:20 BATCHERRORRATE.txt
$
$./BATCHERRORRATE.txt
$nohup BATCHERRORRATE.txt
Sending output to nohup.out
nohup: BATCHERRORRATE.txt: No such file or directory
$
-----------------------------------------------

The file was existing in the folder and I can even access it, but couldn't run, as per error message. I was able to fix it by defining that path to the user profile.

Regards,
Ahmed
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: nohup: ... No such file or directory

Shalom Ahmed,

nohup <scriptname> > BATCHERRORRATE.txt

Will work better.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Victor Fridyev
Honored Contributor

Re: nohup: ... No such file or directory

If you run the script as user root, the command must look like
nohup ./BATCHERRORRATE.txt
HTH
Entities are not to be multiplied beyond necessity - RTFM
Ken O'Neil
Frequent Advisor

Re: nohup: ... No such file or directory

Just to clarify, are you trying to execute BATCHERRORRATE.txt as a script or are you trying to use it as the output file.

If you're trying to execute it, it seems like a path issue; nohup can't find the file you're trying to run. Use an absolute path or relative path as Victor noted is what you need to do if the you're in when you execute it is not in your PATH.

If you're trying to use it as the output file, then Steven's example above works:
nohup script_name > output_filename

Muthukumar_5
Honored Contributor

Re: nohup: ... No such file or directory

Use nohup with syntax as,

# nohup <scriptname> > logfile.

Example:

# cat script.ksh
hostname
ls -l
# chmod u+x script.ksh

# nohup ./script.ksh > logfile

It will make. Else it will treat your log file as script name as per your syntax.

--
Muthu
Easy to suggest when don't know about the problem!
Mridul Shrivastava
Honored Contributor

Re: nohup: ... No such file or directory

U have to use absolute path with nohup.
for example

#nohup /tmp/script > /tmp/log.out &

The above example will execute the script in background but only output will be redirected to /tmp/log.out
Time has a wonderful way of weeding out the trivial
Hunan_1
Frequent Advisor

Re: nohup: ... No such file or directory

Ahmed,

I always execute a script immune to hangups as follows without any problems:

$nohup <script>

example:
$nohup ksh test.ksh

The default output is always nohup.out, even you can execute this in background.

example:
$nohup ksh test.ksh&

Hope this helps

ArunDevarajan15
New Member

Re: nohup: ... No such file or directory

Hi Ahmed,

I have also come across the same issue, though the file is at the same directroy, got 'No such file' error. On my case I edited the file through WinScp first. When i faced the issue, I removed the old file, created the file though cp and edited through vi editor. It woked for me.

Regards,

Arun

Dennis Handly
Acclaimed Contributor

Re: nohup: ... No such file or directory

> On my case I edited the file through WinScp first

 

Yes, evil DOS CRs will mess up the #! interpreter line.