- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: crontab for certain user doesn't work
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
тАО10-10-2012 07:53 AM
тАО10-10-2012 07:53 AM
Re: crontab for certain user doesn't work
Hi, thanks
The result of date is:
> CMD: date >> /usw/app/oracle/admin/CRMISEF1/statspack/sh.log
> oracle 8516 c Wed Oct 10 16:48:00 METDST 2012
< oracle 8516 c Wed Oct 10 16:48:01 METDST 2012 ts=9
the command wasn't executed as expected
The path is:
PATH=/usr/bin:/usr/bin:/opt/ansic/bin:/usr/ccs/bin:/usr/contrib/bin:/opt/hparray/bin:/opt/nettladm/bin:/opt/upgrade/bin:/opt/fcms/bin:/opt/pd/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/mx/bin:/opt/resmon/bin:/opt/perf/bin:/opt/prm/bin:/opt/scr/bin://opt/perl/bin:/opt/ignite/bin:/opt/graphics/common/bin:/usr/sbin/diag/contrib:/opt/OV/bin/OpC:/opt/langtools/bin:/opt/imake/bin:/sbin/fs/vxfs3.5/bin:/usr/symcli/bin:/opt/ssh/bin:/opt/wbem/bin:/opt/wbem/sbin:/opt/gwlm/bin:/usr/local/bin:/opt/networker/bin:/opt/sfm/bin:/opt/CA/eTrustAccessControl/bin::/opt/CA/eTrustAccessControl/bin::/usw/app/oracle/product/8.1.7_64bit/bin:/usr/bin:/etc:/usr/ccs/bin:/usr/local/bin:/usr/sbin:/sbin:bin:.
there is no /etc/shells on that system
I executed the command using sh shell in terminal (over ssh), I just executed it from its directory (./test.sh) - that worked
but it doesn't work from cron
the permissions are 755
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2012 07:55 AM
тАО10-10-2012 07:55 AM
Re: crontab for certain user doesn't work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2012 10:10 AM
тАО10-10-2012 10:10 AM
Re: crontab for certain user doesn't work
>I didn't change /bin/sh to /bin/sh -x but I doubt it would do anything since the script is clearly not even loaded
The script should be loaded and the -x processed. I suspect it is dying in your .profile processing. That -x may give you a clue. Provided you redirect stderr to a file so we can ignore your mail issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2012 01:40 AM
тАО10-16-2012 01:40 AM
Re: crontab for certain user doesn't work
I inserted -x option - to #!/bin/sh -x the cron log is still same:
> CMD: /usw/app/oracle/admin/CRMISEF1/statspack/test.sh 2>&1
> oracle 29277 c Tue Oct 16 10:04:00 METDST 2012
< oracle 29277 c Tue Oct 16 10:04:00 METDST 2012 ts=9
keep in mind that even if I use simple date command, it fail
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-16-2012 10:47 PM - edited тАО10-16-2012 10:47 PM
тАО10-16-2012 10:47 PM - edited тАО10-16-2012 10:47 PM
Re: crontab for certain user doesn't work
>cron log is still same
Of course, since your mail isn't working. You need to put back the redirection of the output:
/usw/app/oracle/admin/CRMISEF1/statspack/test.sh >> /usw/app/oracle/admin/CRMISEF1/statspack/sh.log 2>&1
Then look into sh.log.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2016 03:01 AM - edited тАО05-10-2016 03:05 AM
тАО05-10-2016 03:01 AM - edited тАО05-10-2016 03:05 AM
Re: crontab for certain user doesn't work
Hi,
I got to this post having same issues. First I did not realize what happend but rethiking my steps I found my cause.
I have set the cron for a user on certain of numbers of servers. To avoid login each server, I just created a script to do that for me on all server. The idea was to insert the cronjob onto /var/spool/crontabs/$user. That user had no cronjob setup before so this was first time the file was created.
From here the owner and permisions of the crontab were worg. The file was 644 and the user was root and the group was main group of the root user (using sudo for inserting the conjob into the file)
Soon I have change the permisions to 400 and owner root with user's group (and ofc user part of cron.allow) the cron for the user started to work.
I am not sure if this is going to help you, but I thought is worth to mention it.
Regards,
- « Previous
-
- 1
- 2
- Next »