- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- file not found error, but the file exists.!
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2008 07:13 AM
тАО10-03-2008 07:13 AM
when i try to run script from a scheduler tool, i receive the message "file not found" I can ensure the path and name exists and are correct. What i observe is that some directorys have different owners (user & group) and the script also. I assume that when you not have the appropiate permissions, you can receive a messages as "permission denied" or "cannot execute", but i can not explain my self why i receive the "file not found" message if the file exists. Appreciate your help.
Solved! Go to Solution.
- Tags:
- Permission
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2008 07:25 AM
тАО10-03-2008 07:25 AM
Re: file not found error, but the file exists.!
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2008 07:37 AM
тАО10-03-2008 07:37 AM
Re: file not found error, but the file exists.!
if i do a copy paste from the line in the scheduler and add the ll command in a shell session, the file exists.
ll /opt/script/bin/myshell.sh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2008 08:07 AM
тАО10-03-2008 08:07 AM
Re: file not found error, but the file exists.!
I believe Pete was referring to the file names / commands within the script being run, not the path to the script in the scheduler.
If your using cron, be aware that the environment it provides for a user is not the same as the users login environment. In particular, the PATH is very restricted.
Make sure your script sets PATH as you want it, all required environment variables are set. In addition, beware of relative path names. Unless you "cd" somewhere first, its almost a sure bet you aren't running in the location you think you are. Providing full paths to files will also work.
for example, if your script does:
cp abd /a/b/c/abd
it will fail if you're not in the correct directory it start with, so either change it to something like
cd /filedir
cp abd /a/b/c/abd
or
cp /filedir/abd /a/b/c/adb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2008 08:38 AM
тАО10-03-2008 08:38 AM
Re: file not found error, but the file exists.!
Another consideration is that the verbiage of the message may be non-standard. If you use 'strerror()', for example, in a C program you map the errno of a failed function call to a catalog of standard strings. An errno=2 equates to "No such file or directory". An errno=13 is "Permission denied".
Too, be sure that if you are 'root' and have moved into a directory that you preface relative paths with a dot, as:
# cd /root
# ./myscript
Remember, 'root' does not nor should not have a dot ('.') in its PATH. To do so is a terrible security hole.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2008 08:48 AM
тАО10-03-2008 08:48 AM
SolutionTry this (not as root):
mkdir /tmp/blh
touch /tmp/blh/findme
ll /tmp/blh/findme
(the above ll works OK)
chmod 700 /tmp/blh
chown root /tmp/blh
ll /tmp/blh/findme
Now the ll fails with:
/tmp/blh/findme not found
Login as root and you can once again see the file. The 700 permissions restrict your ability to search the directory. All standard UNIX directory permission stuff.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2008 09:01 AM
тАО10-03-2008 09:01 AM
Re: file not found error, but the file exists.!
Marco C.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-03-2008 12:20 PM
тАО10-03-2008 12:20 PM