Skip to content

Instantly share code, notes, and snippets.

@wamberg
Created April 30, 2010 17:03
Show Gist options
  • Save wamberg/385479 to your computer and use it in GitHub Desktop.
Save wamberg/385479 to your computer and use it in GitHub Desktop.
#!/bin/bash
for i in $( find /chroot/apache/var/www/vhosts -maxdepth 3 -wholename "*/logs/*" | grep -v "17" ); do
filename=$( basename $i )
member_dir=$( dirname $i )
member=$( echo "$member_dir" | awk -F"/" '{ print $7 }' )
echo "Sending $member/logs/$filename"
cat $i | \
gzip -c | \
ssh -i /home/wamberg/.ssh/id_dsa_rsync_user [email protected] "mkdir /silo/backups/logs/$member; cat > /silo/backups/logs/$member/$filename.gz"
echo " -> $member/$filename.gz Created"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment