LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Shh through cron (https://www.linuxquestions.org/questions/linux-general-1/shh-through-cron-944820/)

route 05-14-2012 01:29 AM

Shh through cron
 
Hi,
is it possibe to run ssh command configurd throught crons.
where sshsetup alreday done and logging enbled without password
something like this.

create.sh
ssh xyz@pqr "mkdir mydir"

then i need to schedule this on cron.

EricTRA 05-14-2012 01:43 AM

Hello,

Yes, it's possible to use SSH in scripts. Have a look at the following for some detail:
The Linux Documentation Project
A simple example

Kind regards,

Eric

lithos 05-14-2012 01:44 AM

Hi route

of course you can run it from cron,
first just configure the script to run it form Command line and if it works, then you put it in cron.

Scripts are usually written in shell BASH (or some other)
so look at here on how to write scripts in shell.
Here is a quick example and google should give you a lot of examples on "bash scripting".


All times are GMT -5. The time now is 09:55 PM.