Skip to content

Instantly share code, notes, and snippets.

@mamuz
Last active December 16, 2015 12:28
Show Gist options
  • Save mamuz/5434595 to your computer and use it in GitHub Desktop.
Save mamuz/5434595 to your computer and use it in GitHub Desktop.
#!/bin/bash
# configs
SSH_USR='myuser'
DIR_SRC='/update/directory'
# destinations
SERVER1[0]='custom-app1'
SERVER1[1]='custom-app2'
SERVER1[2]='custom-app3'
SERVER1[3]='custom-app4'
# change to source
cd $DIR_SRC
# push
for i in "${SERVER1[@]}"; do
echo "scp push to "$i":"
scp -r * ${SSH_USR}@server-address1.com:/working/directory/$i
echo "++++++++++++++++++++"
done
# clean
rm -rf *
# success message
echo "update for app done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment