Create a gist now

Instantly share code, notes, and snippets.

anonymous /example
Created Jan 6, 2016

What would you like to do?
Environment=DEV1
ssh -T scpuser@otherhost<<EOSSH
ls /home/shared/scpuser/jenkinsBackup/$Environment/ | xargs rm
EOSSH
echo "Web image stuff"
ssh -T apache@host<<'EOSSH'
cd /var/www/htdocs/sales/JenkinsBackup
echo "test"
echo $Environment
Environment=$(hostname | head -c4)
echo $Environment
if [ "$(ls -A /var/www/htdocs/sales/JenkinsBackup)" ]; then
ls /var/www/htdocs/sales/JenkinsBackup | grep $Environment | xargs rm
echo "Removing previous tars"
fi
##more stuff
EOSSH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment