- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: cron job
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
тАО01-02-2010 09:18 PM
тАО01-02-2010 09:18 PM
cron job
#cat /tmp/inetdtest
ps -ef | grep inetd >> /tmp/inetdcheck
crontab -e
30 * * * * sh /tmp/inetdtest
but cron job is not running ,, i am not getting the updates in /tmp/inetdcheck
i have checked the entry in var/adm/cron/cron.allow file also
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-02-2010 10:24 PM
тАО01-02-2010 10:24 PM
Re: cron job
ll -l /tmp/inetdtest
Change file permission
chmod 755 /tmp/inetdtest
rename the file to
mv /tmp/inetdtest /tmp/inetdtest.sh
crontab - entry as below also check space
30 * * * * /tmp/inetdtest.sh
Hope this Helps,
Regards,
Johnson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-02-2010 10:54 PM
тАО01-02-2010 10:54 PM
Re: cron job
This is missing the interpreter line and replace grep by ps -C:
#!/usr/bin/sh
UNIX95=EXTENDED_PS ps -f -C inetd >> /tmp/inetdcheck
>30 * * * * sh /tmp/inetdtest
This should be:
0,30 * * * * /tmp/inetdtest
>but cron job is not running
Are you getting any mail messages?
> Johnson: Change file permission
Right. Better to use symbolic modes:
chmod a+x /tmp/inetdtest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2010 01:05 AM
тАО01-03-2010 01:05 AM
Re: cron job
first, check the permissions of your file /tmp/inetdtest. It should be executable. so do,
# chmod 755 /tmp/inetdtest
You can omit specifying the 'sh' in your crontab file.
# crontab -e
30 * * * * /tmp/inetdtest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2010 10:31 AM
тАО01-03-2010 10:31 AM
Re: cron job
You noticed that this may find itself, as
well as the real "inetd" process?
> [...] replace grep by ps -C:
Better, but anyone can write a program named
"inetd", and run it.
What are you really trying to test? Are you
looking for a running program named "inetd",
or do you wish to see if (the real) "inetd"
is doing its job properly? It might make
more sense to use a program like cURL,
Telnet, or wget, to see if you can reach some
real service (one which "inetd" would need to
start).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2010 10:54 AM
тАО01-03-2010 10:54 AM
Re: cron job
Insted of this
>30 * * * * sh /tmp/inetdtest
It should like this
0,30 * * * * /tmp/inetdtest
Cross check your /tmp/inetdtest file it should be having executed permissions
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2010 08:29 PM
тАО01-03-2010 08:29 PM
Re: cron job
Better, but anyone can write a program named
"inetd", and run it.
What are you really trying to test? Are you
looking for a running program named "inetd",
or do you wish to see if (the real) "inetd"
is doing its job properly? It might make
more sense to use a program like cURL,
Telnet, or wget, to see if you can reach some
real service (one which "inetd" would need to
start).
how to do with using cURL,TELNET OR wget
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-04-2010 02:22 AM
тАО01-04-2010 02:22 AM
Re: cron job
if you have a http server, you can try this:
#!/usr/bin/sh
wget http://localhost/index.html 1>&2 2>/dev/null
if [ $? -ne "0" ]
then
echo "inetd might not running! Please check"
fi
Unix operates with beer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-04-2010 02:23 AM
тАО01-04-2010 02:23 AM
Re: cron job
#!/usr/bin/sh
curl http://localhost/index.html 1>&2 2>/dev/null
if [ $? -ne "0" ]
then
echo "inetd might not running! Please check"
fi
Unix operates with beer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-04-2010 06:46 AM
тАО01-04-2010 06:46 AM
Re: cron job
How to do _WHAT_?
> What are you really trying to test?
Still wondering...
> [...] 1>&2 2>/dev/null
Personally, rather than send this output
directly to "/dev/null", I'd save the it, and
include it in the e-mail which my script
would send to the system manager if the
operation failed. (Which is what I do in the
DCL procedure which I use on my main VMS
system to check on the Web server. My script
also searches the output for a "200" status
value in the response from the Web server.
As usual, many things are possible, depending
on exactly what one wishes to test.)
> echo "inetd might not running! Please check"
Not what I'd say. If I were testing the Web
server, and the test failed, then I'd
probably say something like "WWW Server Test
Failure.", and follow that with the details,
like, say, "Status 200 missing from log
file.", or "Log file (
not created.", or something like that, and
leave the interpretation to the victim.
But that's just my opinion.