- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Need help in scripting
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
- 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-19-2005 02:25 AM
09-19-2005 02:25 AM
I want to append the cronfile of node2 from node1 as below;
rsh node1 cat /usr/local/bin/ssh-cron-new >> node2:/var/spool/cron/crontabs/root
I know that this won't work.
Can you help me by suggesting a solution ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2005 02:28 AM
09-19-2005 02:28 AM
Re: Need help in scripting
from node2 enter;
rsh node1 'cat /usr/local/bin/ssh-cron-new' >> /var/spool/cron/crontabs/root
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2005 02:30 AM
09-19-2005 02:30 AM
Re: Need help in scripting
crontab -l > /root/crontab
Then add on node1's crontab
remsh node1 cat /usr/local/bin/ssh-cron-new >> /root/crontab
At least I think that's what you're trying to accomplish.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2005 02:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2005 02:35 AM
09-19-2005 02:35 AM
Re: Need help in scripting
I forgot to mention that rsh is configured.
I have to run this script only from node1 and rsh is configured (w/o password) only from node1 to node2.
From node2 to node1 it is not configured. I have around 150 boxes where I need to update the cron file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2005 02:39 AM
09-19-2005 02:39 AM
Re: Need help in scripting
I've never pushed out a file with rsh like John did, but this should also work.
rcp -rp node2:/var/spool/cron/crontabs/root /tmp/root.cron
cat /usr/local/bin/ssh-cron-new >> /tmp/root.cron
rcp -rp /tmp/root.cron node2:/var/spool/cron/crontabs/root
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2005 02:40 AM
09-19-2005 02:40 AM
Re: Need help in scripting
cat /usr/local/bin/ssh-cron-new | rsh node2 " cat >> /var/spool/cron/crontabs/root"
But, since you've got rsh, you've probably also got rcp that you can use:
scp /usr/local/bion/ssh-cron-new node2:/var/spool/cron/crontabs/root
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2005 02:41 AM
09-19-2005 02:41 AM
Re: Need help in scripting
cat nodes.dat |while read NODE ;do
rcp -rp $NODE:/var/spool/cron/crontabs/root /tmp/root.cron
cat /usr/local/bin/ssh-cron-new >> /tmp/root.cron
rcp -rp /tmp/root.cron $NODE:/var/spool/cron/crontabs/root
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2005 02:43 AM
09-19-2005 02:43 AM
Re: Need help in scripting
Solution suggested by John helped me...