ssh/bash script question
I'm trying to log into a remote server and get the uname every 5 minutes. However, I can't get it work. Here is what I attempted
[cd@localhost ~]$ ssh -T email@example.com uname;sleep 2;uname
One the first pass, I get 'FreeBSD', which is the remote servers uname. However, on the second pass I get 'Linux', which is my local host and not the remote host. Can I pass some kind of crude loop construct at the ssh command line?
semicolon ends a command. You're telling bash to ssh in and execute uname. Then that process ends and you execute sleep 2 locally, then uname locally.
ssh -T firstname.lastname@example.org "uname;sleep 2;uname"
Yeah, that was what I was looking for. Thanks.