Dear All I need to schedule for a repeated task on my CentOS server, as the followings: -) Telnet to a remote node -) Issue a command -) Capture the output in a log -) Logout from Telnet -) Wait for a prescribed time interval -) Then redo , but append the subsequent output in just on file Can you please let me know which options do we have to write such a task? Thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20100501/a663dd15/attachment-0001.html>
On Sat, May 1, 2010 at 10:10 AM, hadi motamedi <motamedi24 at gmail.com> wrote:> Dear All > I need to schedule for a repeated task on my CentOS server, as the > followings: > -) Telnet to a remote node > -) Issue a command > -) Capture the output in a log > -) Logout from Telnet > -) Wait for a prescribed time interval > -) Then redo , but append the subsequent output in just on file > Can you please let me know which options do we have to write such a task? > Thank youUse cron to schedule the tasks. if you need to automate an interactive command you can use expect [1][2] [1] http://expect.nist.gov/ [2] http://en.wikipedia.org/wiki/Expect HTH -- Athmane Madjoudj
hadi motamedi wrote:> Dear All > I need to schedule for a repeated task on my CentOS server, as the > followings: > -) Telnet to a remote node > -) Issue a command > -) Capture the output in a log > -) Logout from Telnet > -) Wait for a prescribed time interval > -) Then redo , but append the subsequent output in just on file > Can you please let me know which options do we have to write such a task? > Thank youIf the remote end of this is some dumb device that can only do telnet, use expect, kermit, or perl's Net::Telnet module to chat with it. If it is another computer, set up ssh keys and just run remote commands directly. And use cron to schedule the runs. -- Les Mikesell lesmikesell at gmail.com
On Sat, May 01, 2010 at 10:10:49AM +0100, hadi motamedi wrote: Study up on 'vron' and 'crontab'. ////jerry> Dear All > I need to schedule for a repeated task on my CentOS server, as the > followings: > -) Telnet to a remote node > -) Issue a command > -) Capture the output in a log > -) Logout from Telnet > -) Wait for a prescribed time interval > -) Then redo , but append the subsequent output in just on file > Can you please let me know which options do we have to write such a task? > Thank you> _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos