- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Cron permission problem
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
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
тАО08-31-2006 01:29 PM
тАО08-31-2006 01:29 PM
Cron permission problem
I have a strange cron permission problem. I have a small perl script that needs to run every day at 16:00. The scheduling side of this is no problem. The problem I have is that when cron executes my perl script I get the following error:
sh: in: Execute permission denied.
I've checked the file permission - no problems there. I've also checked that the path to perl in the header of my perl script points to my valid perl path.
I've also checked that the script runs as root without problem from the command line, and there are no problems there either.
I'm a little stumped.
Anyone got some ideas. TIA
Kevin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2006 02:01 PM
тАО08-31-2006 02:01 PM
Re: Cron permission problem
Because of your error message, it appears to me that the shell (which cron uses) rather than Perl is having the problem and the most likely culprit is a small error in your "shebang line"
Is the first line of your Perl script very similar to this?
#!/usr/bin/perl -w
The only other "gotcha" is that stdin is no longer a terminal (tty) device so that too could have some impact depending upon what your script actually does. Notice that it cannot execute the "in" command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2006 02:09 PM
тАО08-31-2006 02:09 PM
Re: Cron permission problem
I had throught that it might be an issue with STDIN / STDOUT but my script simply picks up a file and makes an FTP connection and drops it off the file. That's about it from a functionality point of view for the script. I also looked for the substring "in" in my perl script, and the only place that it exists is in the first line of the script
#!/usr/local/bin/perl
with "in" being a substring of "bin"
What does the -w switch do?
Thanks.
Kevin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2006 02:17 PM
тАО08-31-2006 02:17 PM
Re: Cron permission problem
my $a;
or
our $b;
... but that's a good thing.
Since you are FTP'ing, I assume that you are using Net::FTP. If not, you may be having an input/output rediection problem.
Start by creating your wrapper script and exporting any variables that you might think you need. If there are any commands that you are using that are not in /usr/bin then make sure that you augment PATH or use absolute pathnames.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2006 02:19 PM
тАО08-31-2006 02:19 PM
Re: Cron permission problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2006 02:31 PM
тАО08-31-2006 02:31 PM
Re: Cron permission problem
I tried with a wrapper script. Inside the script I included the .profile for the user. Then I noticed something interesting. I had a mistake in my filename when changing it to the wrapper script, so nothing should have run, yet I got exactly the same error! No I believe that the problem has nothing to do with my perl script at all but something odd happening within the cron sub system. Something I have a question about - does cron have problems running programs if the user that cron is running as has a profile of /bin/false?
Thanks
Kevin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2006 02:43 PM
тАО08-31-2006 02:43 PM
Re: Cron permission problem
I found the problem - and it's a strange error for a simple config problem.
The problem was inmy scheduling. I had 1 too many "*" in my scheduling. I removed the extra and all is well now!
Such a mis-leading error, and what a wild goose -chase.
Thanks for the responses though.
Kevin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2006 02:49 PM
тАО08-31-2006 02:49 PM