Skip to content

Instantly share code, notes, and snippets.

@hito-asa
Created January 28, 2013 09:00
Show Gist options
  • Save hito-asa/4654037 to your computer and use it in GitHub Desktop.
Save hito-asa/4654037 to your computer and use it in GitHub Desktop.
oauth2_refresh_token = JSON.parse(`cat ~/.appcfg_oauth2_tokens`)["refresh_token"]
`#{$APPCFG} request_logs --oauth2 --noauth_local_webserver --oauth2_refresh_token=#{oauth2_refresh_token} --severity=1 --num_days=2 --end_date=#{TARGET_DATE_NAME} #{$SRC_DIR} #{LOG_TMP_DIR}/request.log`
`grep -s "^ [0-9]\\+:[0-9]\\+\\.[0-9]\\+ #{PREFIX_OF_ACTIVITY_LOG} \\(#{TARGET_DATE_PLUS1_NAME} 0[0-3]\\|#{TARGET_DATE_NAME} \\(0[4-9]\\|1[0-9]\\|2[0-3]\\)\\)" #{LOG_TMP_DIR}/request.log | sed "s/^ [0-9]\\+:[0-9]\\+\\.[0-9]\\+ #{PREFIX_OF_ACTIVITY_LOG} //" > #{LOG_FILE}`
GS_DIR = "gs://backetname/activity-log"
`#{$GSUTIL} cp #{LOG_FILE} #{GS_DIR}/#{TARGET_DATE_YMD}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment