开发者

Crontab append remotely

开发者 https://www.devze.com 2023-03-18 10:15 出处:网络
I would like append entries to crontab on a remote server. Something like this. for host in $hosts do ssh $host echo \"5,10,15,20 05,35 8-20 * * * /myhome/myscript\" crontab_fil开发者_StackOverflow社

I would like append entries to crontab on a remote server. Something like this.

for host in $hosts
do
ssh $host echo "5,10,15,20 05,35 8-20 * * * /myhome/myscript" crontab_fil开发者_StackOverflow社区e
done

problem is i do not know the name of the crontab file to which the line needs to be appended with


You should not edit crontab file directly, use always crontab -e (why? read this). But you could create a simple text file with your script and cut&paste into crontab.

0

精彩评论

暂无评论...
验证码 换一张
取 消