Re: [CentOS] How to schedule for a repeated task?

2010-05-03 Thread Les Mikesell
hadi motamedi wrote: > > >Do you do a single iota of research on your own or do you >expect the members of this list to do *everything* for you? > > > > Sorry for wrong question. I just need to know if you see implementing it > via 'expect' or 'nc' is feasible or not?

Re: [CentOS] How to schedule for a repeated task?

2010-05-03 Thread hadi motamedi
Do you do a single iota of research on your own or do you >expect the members of this list to do *everything* for you? > > > > Sorry for wrong question. I just need to know if you see implementing it via 'expect' or 'nc' is feasible or not? I you see it feasible, I will extract the d

Re: [CentOS] How to schedule for a repeated task?

2010-05-03 Thread John R. Dennison
On Mon, May 03, 2010 at 12:02:43PM +0100, hadi motamedi wrote: > > Thank you . It can connect to remote node port 23. But how can I send > command to remote node and capture its log? Do you do a single iota of research on your own or do you expect the members of this list to do *e

Re: [CentOS] How to schedule for a repeated task?

2010-05-03 Thread hadi motamedi
Maybe have a look at nc (man nc)... > > Thank you . It can connect to remote node port 23. But how can I send command to remote node and capture its log? ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos

Re: [CentOS] How to schedule for a repeated task?

2010-05-03 Thread John Doe
From: hadi motamedi >Actually I need to telnet to it and issue some commands and capture the output >of the commands in a file and then wait for a prescribed time interval and >then redo from the start (but I need to append all of the logs in just one >file). Maybe have a look at nc (man nc)..

Re: [CentOS] How to schedule for a repeated task?

2010-05-02 Thread Jobst Schmalenbach
On Sat, May 01, 2010 at 07:12:54AM -0400, Jim Perrin (jper...@gmail.com) wrote: > On Sat, May 1, 2010 at 5:52 AM, hadi motamedi wrote: [snip] > Several things are wrong with this: > > 1. DO NOT EVER USE TELNET. While I 100% agree with this you need to refine the wording a little > 1. DO N

Re: [CentOS] How to schedule for a repeated task?

2010-05-01 Thread hadi motamedi
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? > > > No, actually I wanted to copy remote node /tmp/log.cap to its /export/home. Please correct me. Thank you ___

Re: [CentOS] How to schedule for a repeated task?

2010-05-01 Thread hadi motamedi
As others have already pointed out, this can be done with a simple > bash script, even if you do use telnet. I'd suggest getting a good > bash reference and learning it, or perl for a more robust interface. > > Thank you for your reply. From your first message regarding using expect to do the job

Re: [CentOS] How to schedule for a repeated task?

2010-05-01 Thread Jerry McAllister
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 > -) Logou

Re: [CentOS] How to schedule for a repeated task?

2010-05-01 Thread Kwan Lowe
On Sat, May 1, 2010 at 10:52 AM, Les Mikesell wrote: > 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

Re: [CentOS] How to schedule for a repeated task?

2010-05-01 Thread John R Pierce
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/h

Re: [CentOS] How to schedule for a repeated task?

2010-05-01 Thread MHR
On Sat, May 1, 2010 at 2:52 AM, 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

Re: [CentOS] How to schedule for a repeated task?

2010-05-01 Thread Athmane Madjoudj
> > Several things are wrong with this: > > 1. DO NOT EVER USE TELNET. > Seriously. Don't do this. It sends your user/pass in plain text. It's > a horrendous security risk. I don't care what excuse you have to try > to defend it. DO NOT DO IT. Use ssh keys instead. > I agree but some devices doesn

Re: [CentOS] How to schedule for a repeated task?

2010-05-01 Thread Les Mikesell
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 sub

Re: [CentOS] How to schedule for a repeated task?

2010-05-01 Thread hadi motamedi
> 1. DO NOT EVER USE TELNET. > > 2. Use ssh keys instead of setting a password in the script. > > 3. You don't need to use expect to set the PWD to /tmp. You can do > this with basic scripting. Pick up a bash scripting guide and read > through it. I see almost nothing in your example that requires

Re: [CentOS] How to schedule for a repeated task?

2010-05-01 Thread Jim Perrin
On Sat, May 1, 2010 at 5:52 AM, hadi motamedi wrote: > 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 "log

Re: [CentOS] How to schedule for a repeated task?

2010-05-01 Thread hadi motamedi
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 >expe

Re: [CentOS] How to schedule for a repeated task?

2010-05-01 Thread Athmane Madjoudj
On Sat, May 1, 2010 at 10:10 AM, 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 >

[CentOS] How to schedule for a repeated task?

2010-05-01 Thread hadi motamedi
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 p