Skip to content

Instantly share code, notes, and snippets.

@jasonbaker
Created October 21, 2011 18:35
Show Gist options
  • Save jasonbaker/1304586 to your computer and use it in GitHub Desktop.
Save jasonbaker/1304586 to your computer and use it in GitHub Desktop.
#!/bin/bash -xe
HOSTNAME=`hostname | sed 's/.managed.contegix.com//' | sed 's/apture-//'`
REMOTE_PATH="/home/csar/logs/spawning/${HOSTNAME}/"
DESTINATION="csar@apture-stat01"
cd /var/log/spawning
echo "Syncing to ${DESTINATION}:${REMOTE_PATH}"
for f in $(ls *.log.gz); do
scp "$f" $DESTINATION:$REMOTE_PATH && rm -f "$f"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment