我希望继续添加更多的ips,我显然不想继续一个一个地添加,任何人都可以帮助我动态构建某种数组,我可以通过crontab每10分钟执行一个shell文件?
这是我的 cronjob 中的内容:
*/10 * * * * scp /var/lib/asterisk/agi-bin/* 72.119.110.20:/var/lib/asterisk/agi-bin/ >/dev/null 2>&1
*/10 * * * * scp /var/lib/asterisk/agi-bin/* 72.119.110.21:/var/lib/asterisk/agi-bin/ >/dev/null 2>&1
*/10 * * * * scp /var/lib/asterisk/agi-bin/* 72.119.110.22:/var/lib/asterisk/agi-bin/ >/dev/null 2>&1
*/10 * * * * scp /etc/asterisk/extensions.conf 72.119.110.20:/etc/asterisk/extensions.conf >/dev/null 2>&1
*/10 * * * * scp /etc/asterisk/extensions.conf 72.119.110.21:/etc/asterisk/extensions.conf >/dev/null 2>&1
*/10 * * * * scp /etc/asterisk/extensions.conf 72.119.110.22:/etc/asterisk/extensions.conf >/dev/null 2>&1
*/10 * * * * scp /etc/asterisk/sip.conf 72.119.110.20:/etc/asterisk/sip.conf >/dev/null 2>&1
*/10 * * * * scp /etc/asterisk/sip.conf 72.119.110.21:/etc/asterisk/sip.conf >/dev/null 2>&1
*/10 * * * * scp /etc/asterisk/sip.conf 72.119.110.22:/etc/asterisk/sip.conf >/dev/null 2>&1
非常感谢您编写脚本以实现此目的的任何帮助。再一次感谢你。