Script to run php script on multiple website domains

Good Day,

I have multiple websites on a domain. I am looking for a loop structure that can run each site script. egdomain1/test.php domainx/test.php so on, currently I copy and paste a list of commands but that skips certain commands. Some help would be greatly appreciated.

Sergio

Are you doing a web call or some ssh command line call? wget can do web calls, and a for loop can deal with a list of hosts and commands.

at the moment I am using lynx -dump to run the php file

I have a list of these for all the domains. What I am trying to get is that it would run each lynx command one after the other. ie run lynx -dump domainame1/phpfile.php finish running then run lynx -dump domain name2/phpfile.php

Is there a better way of doing this?

The script is to pull data from a large database and post it in the site specific database.

Thanks

1 Like

Well, wget is simpler than lynx, but it sounds like simple scripting:

for dom in dom1 dom2 dom3 dom4
do
 lynx -dump $dom/phpfile.php >output.$dom
done