- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Crontab 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
тАО03-19-2010 02:14 PM
тАО03-19-2010 02:14 PM
Crontab problem
I trying to include a script in my crontab as user. I used "crontab -e" to include my script there but does not seem to work.
15 08 * * * /tmp/test
If I understand correctly it is set to run at 08:15 every day, correct?
Can anybody identify any error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2010 03:01 PM
тАО03-19-2010 03:01 PM
Re: Crontab problem
What, exactly, does that mean? No
"/tmp/sample1" file created, or what?
> [...] correct?
Looks ok to me (which does not prove much).
ls -l /tmp/test
This works interactively?:
/tmp/test
"/tmp" is not where I'd put a script which I
intended to run every day.
Around here:
dyi # date ; ls -l /tmp/samp*
Fri Mar 19 17:56:12 CDT 2010
-rwxr-xr-x 1 sms users 65 Mar 19 17:54 /tmp/sample
-rw-r--r-- 1 sms users 11 Mar 19 17:56 /tmp/sample1
dyi $ crontab -l
56 17 * * * /tmp/sample
dyi $ cat /tmp/sample
#!/usr/bin/sh
#This is a sample
echo " Sample 01" > /tmp/sample1
dyi $ uname -a
HP-UX dyi B.11.31 U ia64 4235313755 unlimited-user license
Is your OS a secret?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2010 03:22 PM
тАО03-19-2010 03:22 PM
Re: Crontab problem
# uname -a
HP-UX pruebas B.11.31 U ia64 3246142436 unlimited-user license
# ps -ef | grep cron
root 1777 1 0 Feb 18 ? 1:58 /usr/sbin/cron
# date
Fri Mar 19 17:14:03 MXST 2010
# crontab -l
15 17 * * * /tmp/test
$ date
Fri Mar 19 17:15:10 MXST 2010
# cd /tmp
# pwd
/tmp
# ll sample*
sample* not found
As you can see the cron is running but it does not execute the script.
Any suggestion?
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2010 03:53 PM
тАО03-19-2010 03:53 PM
Re: Crontab problem
You can do a test from the user you are trying to run the cron.
- Also check if the user is permitted to use cron, in cron.allow user entry should be there.
Check with executing from command prompt:
$ ls -l /tmp/test #Make sure it is executable.
$ /tmp/test
$ ls -l /tmp/sample*
If this work , cron supposed to work at the given time.
Hth,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2010 03:59 PM
тАО03-19-2010 03:59 PM
Re: Crontab problem
> does not execute the script.
Can _you_ execute it?
> ls -l /tmp/test
> /tmp/test
> $ ls -l /tmp/test #Make sure it is executable.
>
> $ /tmp/test
Still wondering...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2010 04:16 PM
тАО03-19-2010 04:16 PM
Re: Crontab problem
The script has exec. permissions
I executed the script and this is the out:
$ whoami
dsarmien
$ pwd
/tmp
$ ll test
-rwx------ 1 dsarmien users 65 Mar 19 09:57 test
$ cat test
#!/usr/bin/sh
#This is a sample
echo " Sample 01" > /tmp/sample1
$ ll sample1
sample1 not found
$ ./test
$ ll sample1
-rw-r--r-- 1 dsarmien users 11 Mar 19 18:05 sample1
$ cat sample1
Sample 01
The user dsarmien is permitted to use cron:
$ cat /var/adm/cron/cron.allow
root
dsarmien
$ crontab -l
15 17 * * * /tmp/test
$ whoami
dsarmien
Thanks for your attention.
DASM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2010 04:19 PM
тАО03-19-2010 04:19 PM
Re: Crontab problem
Yes, I can execute the script.
$ ll test
-rwx------ 1 dsarmien users 65 Mar 19 09:57 test
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-20-2010 03:07 AM
тАО03-20-2010 03:07 AM
Re: Crontab problem
/var/adm/cron/log
Note: test is a bad name for a script since it conflicts with the shell builtin. But since you use an absolute path, it should work for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-20-2010 03:33 AM
тАО03-20-2010 03:33 AM
Re: Crontab problem
you can also try
sh /tmp/test in cron script.
Although urs things is right.
BR,
Kapil+
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2010 10:39 AM
тАО03-22-2010 10:39 AM
Re: Crontab problem
I only restarted the server and after that it worked correctly.
It was weird because I know it was not necessary to restart in order the cron executes the script.
There were no incidents in the log of the cron.
Thanks to all for answering.
Regards.