Skip to content

Instantly share code, notes, and snippets.

@aranair
Created September 28, 2017 17:57
Show Gist options
  • Save aranair/9d0ddc9d0bfa34b176b60649511662c1 to your computer and use it in GitHub Desktop.
Save aranair/9d0ddc9d0bfa34b176b60649511662c1 to your computer and use it in GitHub Desktop.
strace s3 uploader
#!/bin/bash
while true; do
YEAR=`date +%Y`
MONTH=`date +%m`
DAY=`date +%d`
HOUR=`date +%H`
MINUTE=`date +%M`
ARR=$(pidof "Passenger NodeApp: /srv/factory" | tr " " "\n")
STR=""
for VAR in $ARR
do
STR="${STR} -p ${VAR}"
done
$(timeout -sHUP 1m strace ${STR} -o strace.log)
aws s3 cp strace.log s3://homan-test-bucket/logs/ge/${YEAR}/${MONTH}/${DAY}/${HOUR}/strace_${MINUTE}.log
rm strace.log
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment