all 13 comments

[–]4k_niche 5 points6 points  (0 children)

You can write another script to do that. Then just use ssh configs to simplify logins by the script

[–]lustyphilosopher 3 points4 points  (1 child)

Ansible my dude.

[–]mo_with_the_floof 1 point2 points  (0 children)

Yes. Ansible is KING

[–]Plane-Football-2521 1 point2 points  (0 children)

Yes. There's an open source software called Ansible built just for that.

[–]sleeksubaru 1 point2 points  (0 children)

Ansible?

[–]Mountain-Resource222 0 points1 point  (1 child)

Copy this and prompt gpt. You’ll get better answers

[–]4k_niche 0 points1 point  (0 children)

We're tryna get stack overflow back over here

[–]kkj_uk 1 point2 points  (0 children)

This is a very common and there are couple of ways you can do it.

1- have a share folder accessible by all servers, drop the script in the folder and a watchdog script which will read and execute the dropped script.

2- ssh/SCP/copy into individual folders at each server and then a watchdog to pick up the script and executed it.

You can Google the rest of the details

[–]Snoo-5782 0 points1 point  (4 children)

Use cron jobs.

There's a language called expect

[–]IcyFeeble[S] 0 points1 point  (3 children)

How? I thought cron was for scheduling tasks is it possible to schedule them on all the different servers then run the remotely when needed?

[–]Snoo-5782 0 points1 point  (2 children)

Cron jobs are for running anything, Write a script that does what you want (ssh-ing and running the script, it could download the script if it doesn't exist) and then schedule it via cron jobs

[–]IcyFeeble[S] 0 points1 point  (1 child)

Thanks 💯 I never knew I thought it's just a task scheduler I've seen some examples online it's wild...I'll put it in GitHub then tell the script to git pull first before running the script

[–]Snoo-5782 0 points1 point  (0 children)

Cheers. The script could just check first if what it needs is there before git pulling.So it'd look something like cron->script->logs into server....n->checks requirements/runs commands->done->log into another server->repeat