- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- about my script !
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
Discussions
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
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
09-15-2003 12:01 AM
09-15-2003 12:01 AM
about my script !
so the process of rpcd(on my hp workstation) is often be killed by the virus on the windows systems!
because of my 10.10 os ,there is no patch for it
so i write a script:
RPCD=$(ps -ef |grep -c rpcd)
if [ $RPCD -eq 0 ]
then
/opt/dce/sbin/rpcd
date > /script/rpcd/date
fi
it can be run manually
but when i put it into cron
i will not be execute!
why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2003 12:07 AM
09-15-2003 12:07 AM
Re: about my script !
RPCD=$(ps -ef|grep -v grep|grep -c rpcd)
The way to restart rpcd is;
/sbin/init.d/Rpcd start
Give that a try.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2003 12:16 AM
09-15-2003 12:16 AM
Re: about my script !
RPCD=$(ps -ef|grep -c [r]pcd)
Rgds,
JL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2003 03:35 AM
09-15-2003 03:35 AM
Re: about my script !
You might want to try test instead, like:
if (test $RPCD = 0)
hope that helps,
Kevin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2003 03:40 AM
09-15-2003 03:40 AM
Re: about my script !
Have you checked the output from the cron, to see what exactly the error is?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2003 03:43 AM
09-15-2003 03:43 AM
Re: about my script !
i didn't find /sbin/init.d/Rpcd on my system
my os is hpux 10.10
i found /sbin/init.d/dce
can i use /sbin/init.d/dce start instead?
thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2003 03:47 AM
09-15-2003 03:47 AM
Re: about my script !
The environment is minimal.
No TERM, limited PATH.
To avoid this, I make sure any scripts called by cron either have a complete PATH or each command has the full path of the binries you are calling.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2003 03:55 AM
09-15-2003 03:55 AM
Re: about my script !
the problem may be the way that i start the rpcd daemon!
but i have use the absolute path : /opt/dce/sbin/rpcd
but in this situation
i can execute the script manually!
but cron can't!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2003 04:21 AM
09-15-2003 04:21 AM
Re: about my script !
The first line of your script should specify which shell to use, e.g.:
#!/usr/bin/sh
When you execute your script on the command line it is executed in your current shell - and that is probably not the same as the cron default shell. Therefore, specify the shell.
Anyway, what error do you get from cron?
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2003 04:23 AM
09-15-2003 04:23 AM
Re: about my script !
Try to redirect the output from your cron job to a log file and see if you get any error messages.
0,15,30,45 * * * * <script> >>/tmp/abc.log 2>1
Another solution for this may be to start rpcd from inittab with the respawn option.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2003 05:23 AM
09-15-2003 05:23 AM
Re: about my script !
I would suggest that you change
2>1
in Leif Halvarsson's suggestion to
2>&1
but if the output from a cron script is not redirected to a file, it is mailed to the crontab user; check also the mail messages.
regards,
John K.