run commands in remote machine
hi,
Iam using redat EL4. I want to do run some commands on a remote machine using ssh through a script. I already setup ssh-keygen and all so that ican run some commands using cronjob. Now i want to create database ( postgreqsl) in remote machine at a predfined time.
The commands to executed on remote machine are
#service postgresql restart
#su postgres
$dropdb testatabase
$psql testdatabase
$\i testdatabase.sql
$\q
$ctrl+d
how can i do that. please advice.
thanks
Lhrt
|