question regarding a cronjob?
Hi All,
I have a set of servers that are interconnected.I have recently modified a cronjob entry for one of the servers.I want the same entry to be copied in rest of the servers that are connected.Is there a way to do this without actually going to each server manually editing the crontab -e file and adding the entry.If yes how can I do this task. Thanks, Ajit |
i guess no direct way to do, but this task can solve by creating a SHELL script and execute it all servers from a loop.
|
Quote:
For Ubuntu: Copy this file from the server where you added your cron job and place it in the other servers: Code:
/var/spool/cron/crontabs/<username> Code:
/var/spool/cron/<username> |
For the perms specify the -p option. But some good things to look at here are MTPuTTY(Multi-Tabbed) and PuTTYCS(Command Sender). both of these will allow you to send the same command to all of your open ssh sessions without having to use screen or create ssh in a for loop.
|
Probably the copy n paste soln for a one off for a reasonable num (<10) servers.
Otherwise its worth building eg an ssh script for future use, or even adding a cfg engine like puppet. |
Thank you all for all your valuable suggestions.
|
All times are GMT -5. The time now is 11:34 PM. |