Operating System - HP-UX
1756707 Members
2242 Online
108852 Solutions
New Discussion юеВ

Re: Expect script for pushing out cron

 
allanm77
Frequent Advisor

Expect script for pushing out cron

Hi!

 

I am in need of an expect script to update cron on multiple hosts. Expect is installed on the system and I am hoping if someone has a handy script already, to update cron on multiple hosts from an admin host, please share.

 

Thanks,
Allan.

 

 

 

2 REPLIES 2
allanm77
Frequent Advisor

Re: Expect script for pushing out cron

for j in `cat host-list`
do
expect -f /tmp/sshlogin.expect
done

can't read "j": no such variable
while executing
"spawn ssh -n username@$j 'crontab -l | tee /tmp/info'"
(file "/tmp/sshlogin.expect" line 2)

Dennis Handly
Acclaimed Contributor

Re: Expect script for pushing out cron

Any reason you need expect rather than use ssh password-less?