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.

27 lines
621 B
Bash

9 months ago
#!/bin/bash
LOCATIONS="nova singapore sydney dublin brazil"
9 months ago
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
9 months ago
for location in ${LOCATIONS}
do
OUTDIR="logs/${location}"
[[ -d ${OUTDIR} ]] || mkdir -p ${OUTDIR}
9 months ago
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}
9 months ago
fi
9 months ago
done