Copying remote code to new installs

Code copy script

5 new local servers need to be built from different server installs and code base installs is todays scripting challenge. This would normally be loads of scp commands for all the different servers so I thought I would write a script to choose the server and code base I’m pulling from. I need this script to allow other members of the team to be able to install code on new servers whereas I would not be available

The script belows allows the user to choose the server and code base by using “read -p” to a variable and with a simple confirmation with a y or n so the user nows where he/she are copying from. At the moment its copying static file locations to /var/www/copy/ but this can easily be modified to change the install location .

future changes: Adding a variable for logging as I plan to keep a log of every install that is made

Leave a Comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>