LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-14-2012, 01:29 AM   #1
route
LQ Newbie
 
Registered: Feb 2009
Posts: 22

Rep: Reputation: 0
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.
 
Old 05-14-2012, 01:43 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
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
 
Old 05-14-2012, 01:44 AM   #3
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
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".
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Cron directories: /var/spool/cron/cron.GfqqGO Woodsman Slackware 4 05-11-2011 02:37 PM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U SUSE / openSUSE 11 01-04-2007 01:57 AM
unable to connect shh ryancoolest Linux - Networking 1 07-04-2006 12:54 AM
unable to connect shh ryancoolest Linux - Networking 1 07-03-2006 08:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration