Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #!/bin/bash
  2. shopt -s extglob
  3. currentDate=$(date +%F)
  4.  
  5. echo $currentDate
  6. command="grep $currentDate"
  7. gcs3='s3://gc-reporting-pud-production/splunk_printer_log_files'
  8. gcs3ls='aws s3 ls 's3://gc-reporting-pud-production/splunk_printer_log_files/SOUTH_ASIA/' --recursive '
  9. ssyss3=s3://ssyssplunk
  10.  
  11. gcs3Current=$($gcs3ls|$command|sed 's/^.*(splunk_printer.*)/1/g')
  12.  
  13. SAVEIFS=$IFS
  14. IFS=$(echo -en "nb")
  15. s3ls='aws s3 ls --human-readable --summarize 's3://ssyssplunk/' --recursive'
  16. echo "ls: " $s3ls
  17. egrepCommand="'$currentDate|Total'"
  18. echo "grep: " $egrepCommand
  19. totalSize=$($s3ls|egrep $currentDate|Total|awk -F 'Total Size:' '{print $2}'|sed '/^$/d')
  20. echo "total size: " $totalSize
  21. IFS=$SAVEIFS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement