- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: crontab question
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
Forums
Discussions
Discussions
Forums
Discussions
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
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
02-19-2002 11:49 PM
02-19-2002 11:49 PM
crontab question
crontab -e
30 08 * * * "su - pin -c /home/pin/shellname"
but cron doesnot work ,there should be some messages to inform me about the check info,but i cannot find these messages.
from book ,i find something about cron:cron only use /usr/bin/sh surrounding and can not use your surrounding. i can understand these words exactly,does it mean that i cannot use a shell script in crontab??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2002 11:55 PM
02-19-2002 11:55 PM
Re: crontab question
Try specifying the full path for su in the crontab ie. /usr/bin/su.
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2002 11:57 PM
02-19-2002 11:57 PM
Re: crontab question
of course you can use shellscripts with cron. Why the hell should we need cron else? First:
the messages go to the mail account of the user who starts the cronjob. If you want messages to come to another point, you have to redirect them.
cronjob >/dev/pts/0 for example
if you write a shellscript, the first line should be:
# !/usr/bin/desired_shell
to show the script which shell should interpret it
then your cron job shoul work....
Allways stay on the bright side of life!
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 12:02 AM
02-20-2002 12:02 AM
Re: crontab question
30 08 * * * "su - pin -c /home/pin/shellname"
to
30 08 * * * su - pin -c "/home/pin/shellname"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 12:03 AM
02-20-2002 12:03 AM
Re: crontab question
30 08 * * * /usr/bin/su - pin -c "/home/pin/shellname"
Hope this helps.
Kenny.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 12:04 AM
02-20-2002 12:04 AM
Re: crontab question
The fault lies with your double-quotes. I just tested. With the quotes, the whole string will be taken as a command.
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 12:05 AM
02-20-2002 12:05 AM
Re: crontab question
/var/adm/cron/log
This should show the start & finish times of the cron job.
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 12:46 AM
02-20-2002 12:46 AM
Re: crontab question
following is my date:
# crontab -e
"/var/tmp/aaaa10044"
45 16 * * * usr/bin/su - pin -c "/home/pin/ok"
/var/tmp/aaaa10044" 1 line, 39 characters
warning: commands will be executed using /usr/bin/sh
# crontab -l
45 16 * * * usr/bin/su - pin -c "/home/pin/ok"
# date -u
Wed Feb 20 16:44:12 UTC 2002
# date -u
Wed Feb 20 16:45:20 UTC 2002
# cat log
! *** cron ????????? *** pid = 1088 Tue Feb 19 12:10:13 EAT 2002
> CMD: /home/pin/ok
> root 9364 c Wed Feb 20 22:48:17 EAT 2002
< root 9364 c Wed Feb 20 22:48:17 EAT 2002
after 16:45,i use pin user ,but there is no mail.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 12:56 AM
02-20-2002 12:56 AM
Re: crontab question
did you check the first line of script?
# !/path_to_shell_to_interpret_the_script
you do a switchuser to desired user. Do you have an entry in the cron.allow for that user?
A su - changes identity and also the environment to the users environment. Which shell does the user have as entry in the /etc/passwd- file?
Allways stay on the bright side of life!
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 01:02 AM
02-20-2002 01:02 AM
Re: crontab question
You missed out the /.
Change:
45 16 * * * usr/bin/su - pin -c "/home/pin/ok"
To:
45 16 * * * /usr/bin/su - pin -c "/home/pin/ok"
Hope this helps. Regards.
Steven Sim Kok Leong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 05:07 PM
02-20-2002 05:07 PM
Re: crontab question
tsrad 30> date
Thu Feb 21 17:10:24 EAT 2002
tsrad 31> date -u
Thu Feb 21 09:10:26 UTC 2002
which time should be used in crontab?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 05:13 PM
02-20-2002 05:13 PM
Re: crontab question
Do this:
cat /etc/TIMEZONE. This will display the default system TZ setting and whatever that is, that is what you use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 05:55 PM
02-20-2002 05:55 PM
Re: crontab question
cat TIMEZONE
TZ=EAT-8
export TZ
tsrad 45> date
Thu Feb 21 17:57:42 EAT 2002
tsrad 46> date -u
Thu Feb 21 09:58:00 UTC 2002
does it mean that i shoule use 09:58:00 ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 07:13 PM
02-20-2002 07:13 PM
Re: crontab question
05 * * * * /usr/bin/su - pin -c "/home/pin/ok"