Skip to content

Instantly share code, notes, and snippets.

Created January 6, 2016 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7bcdac7fa384723b1e91 to your computer and use it in GitHub Desktop.
Save anonymous/7bcdac7fa384723b1e91 to your computer and use it in GitHub Desktop.
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