|Sep 18, 2008, 04:15 PM||#1|
automating shell: SSH-ing, runing various script, etc
At work I need to run a few commands, with different parameters from time to time on a remote server using SSH.
I'd like to automate these action using <insert best solution here>
Options would be Automator, Applescript, Python, Perl or Ruby
I don't really know any of these languages, but I do have a good programming background (used with shell, done C/C++ and turbopascal long ago, Actionscript 2, php, etc)
I'd like to script to ask for the few parameters needed, and then running the scripts in order. It is important that the script can wait for the previous call to finish before it continue...
an example would be:
- ask for the target server
- ask for a campaign name
- ask for a version number
- ssh to a server "x"
- run a few scripts on server "x" using provided params
- ssh *from* server "x" to server "y"
- call a script
- cd to a certain folder
- delete a folder
- unzip a file and move it to another location afterward
- call a script
Might seem a "lot" but it's actually not much
If anyone can help me in any way, that'd be really appreciated;
Thanks to you all
|Sep 18, 2008, 05:44 PM||#2|
Do it in BASH
Most of the stuff you seem to want would be easiest to do with BASH scripts IMO. If you want to package it all into a GUI, automator would be a good front end(you can run terminal commands/scripts pretty easily from Automator)
|Sep 18, 2008, 10:25 PM||#3|
You could do it in perl, but I'd do it with a bash script.
And I'd send those "ask for" items as command line args or in a parameter file that you pass on the command line or automatically search for.
Of crimes---none is greater than having things that one desires;
Of disasters---none is greater than not knowing when one has enough.
Of defects---none brings more sorrow than the desire to attain.
|Sep 18, 2008, 11:35 PM||#4|
If it were me I'd do it in a simple sh (bash) script if I wanted it to be "quick and dirty" But if I wanted good error checking, like for example I might try to "ping" the server after the name was entered to verify it was entered correctly and was up and running. I'd check that a script was present before trying to run it and so on. It could easily be that you have 12 lines or "real" work and 200 lines devoted to errors and exceptions and printing messages about same. So Perl or bash depending on the level of error handling sophistication required.
|Sep 19, 2008, 10:37 AM||#5|
Thanks for your answers
I'd rather go with a quick and dirty solution; there's no *real* need for error checking in that case
I'll consider using Bash script and start to try and gather some info about it; If any of you have good resources online that you want to share it would be nice
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|using automator instead of hazel||punktilend||Mac Programming||7||Sep 16, 2011 07:53 PM|
|Help making Bash Script work with Lion?||Yujenisis||Mac Programming||4||Sep 13, 2011 03:57 PM|
|there HAS to be this itunes script available somewhere ...||eroxx||Mac Applications and Mac App Store||2||Aug 21, 2011 09:56 PM|
|looking for a specific automation/script for itunes ... >||eroxx||OS X||0||Jun 4, 2011 08:17 PM|
|Turning iMac G4 into a multimedia center and automation||themacguy12||iMac||1||Dec 16, 2010 06:23 PM|
All times are GMT -5. The time now is 09:30 AM.