You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
LOCATIONS="nova singapore sydney dublin brazil"
|
|
|
|
if [[ "$USER" == "nick" ]]; then
|
|
|
|
SSHKEY="~/.ssh/id-nick"
|
|
|
|
else
|
|
|
|
SSHKEY="~/.ssh/id-paco-2022"
|
|
|
|
fi
|
|
|
|
|
|
|
|
while getopts "j" arg; do
|
|
|
|
case "$arg" in
|
|
|
|
j )
|
|
|
|
JUST_ACCESS='true'
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
for location in ${LOCATIONS}
|
|
|
|
do
|
|
|
|
OUTDIR="logs/${location}"
|
|
|
|
[[ -d ${OUTDIR} ]] || mkdir -p ${OUTDIR}
|
|
|
|
if [[ -n "$JUST_ACCESS" ]]; then
|
|
|
|
scp -pr -i ${SSHKEY} "admin@${location}.nickhope.world:/var/log/apache2/access.log" ${OUTDIR}
|
|
|
|
else
|
|
|
|
scp -pr -i ${SSHKEY} "admin@${location}.nickhope.world:/var/log/apache2/*" ${OUTDIR}
|
|
|
|
fi
|
|
|
|
done
|