Hello Folk,
I am monitoring the 5 servers say (server1,server2,server3,server4,server5).
I have to run the script on all these servers to take the daily-backup.
Currently I have the script on individual servers and running that.
What I want that, I want to have the script Only on server1
and want to run it on all the servers.Need the suggestion…
@FeatherMonkey
rsync did’nt solve my problem.
myproblem is to run Single Python-Script on multiple server.
suppose I have PYTHON script ‘backup.py’
on server1 at location username@server1:/home/backup.py
I want to run this script on remaining servers i.e. server2,server3,server4 and so on.
Think you’re trying to fit the sqr peg in the round hole.
Or looking at it wrong I don’t know of a way to do what you’re asking that sounds like clustering in my crude opinion. Or executing a script based on one system on another(Still think clustering or distributed processing perhaps is a better fit)
rsync may of been too specific the principle is the same pull don’t push.
Without seeing the code you must be pushing to server 1 some how so don’t re-write the script to pull. Either that or you’re backing up locally to the script.
A quick google showed me there is the abilty to use ssh in python how exactly I didn’t look. To me python is overkill for backup there is plenty of tools around that can do this.
I’m a Linux noob… but couldn’t you make a script that will transfer your script to Server2 then run it, then transfer the script to Server3 and run it, etc.? I do this all the time on my Windows machines and just now starting to learn how to do it on Linux machines. I’ve got something in mind and will test it out. If it works, I’ll post what I came up with.
Why don’t you mount server2 … serverN filesystem with sshfs on
server1 and run the script on it?
VampirD
Microsoft Windows is like air conditioning
Stops working when you open a window.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/
Okay. Just to make things simple…
I made a script that will list the contents of the root directory and print the output to a file. Let’s call this script list.sh.
Then created another script that will send this script to another server and run it. Lets call this script send.sh.
The code was
But this solution, like the rsync one, is in fact only a way to distribute the script to the other systems. And that is not what the OP wants. I even doubt if having the script on an NFS exported directory on server1, to be mounted on the other systems is what he wants. But like FeatherMonkey I muss point out that executing a script (square peg) on a system where it is not available (round hole) is not easy to be solved.
Hi
I’ve done it with perl because my scripts kept getting deleted during
upgrades, I was only collecting some data. The script would telnet to a
server, prepare some data, then ftp it back. The script only ever
existing on my local machine.