Created
February 18, 2011 08:31
-
-
Save yllan/833413 to your computer and use it in GitHub Desktop.
grab the folder under each AppId before $YESTERDAY (include)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
. /etc/bashrc | |
. /etc/profile | |
MONTHAGO=`date --date='31 day ago' +%Y/%m/%d` # Linux | |
#MONTHAGO=`date -v -31d +%Y/%m/%d` # BSD | |
/mnt/lib/hadoop/bin/hadoop fs -lsr /log_data | awk -F/ "NF==6" | grep -E "[0-9]{4}/[0-9]{2}/[0-9]{2}$" | awk -F/ "\$4\"/\"\$5\"/\"\$6 < \"$MONTHAGO\"" | awk '{print $8}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment