Re: How to schedule for a repeated task?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



hadi motamedi wrote:
>
>
>     if you need to automate an interactive command you can use expect
>     [1][2]
>
> Thank you for your reply. I am trying like the followings:
> #expect
> >set name 172.16.17.160
> >set user id
> >set password pwd
> >set cmd1 "cd /tmp"
> >set cmd2 "cp log.cap /export/home"
> >set cmd3 "logout"
> >spawn telnet $name
> >expect "login:"
> >send "$user"
> >expect "Password:"
> >send "$password"
> >send "$cmd1"
> >send "$cmd2"
> >send "$cmd3"
> >exit

that cp command is executed on the remote system, so it will copy your 
log.cap file to /export/home on the remote system.   is that what you 
want to do?


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux