I figure that this is a shell scripting issue so I'll post here.
I'm attempting to deploy a cronjob to a variety of servers, some 200-odd, of all walks of life. Mostly AIX, but some Solaris, some HP-UX, some Linux (of varying distributions), etc. I initially thought about utilizing a mass deployment with a scripted rsh or ssh command, echoing in an appended line that contained the cronjob and executing a refresh/restart of the cron service. But that won't work, so I'm stuck with another method, utilizing a vi command. This is supposed to be doable but I'm having some trouble visualizing it. If someone could get me started in the right path that would be great, or provide a script that they've used in the past.
Secondly, if simply echoing/inline editing crontab entries won't work, what will I need to do if I need to edit the file after the initial deployment and adjust the entry for whatever reason (syntax error, change the execution time/date, etc.)? A friend of mine suggested using a perl script that invokes a vi-style search-and-replace function but will these changes be seen by cron on these systems or not? If not, is there another method recommended?