Skip to content

Instantly share code, notes, and snippets.

@darkleaf
Created January 6, 2015 10:29
Show Gist options
  • Save darkleaf/39561760e736fc0b95b9 to your computer and use it in GitHub Desktop.
Save darkleaf/39561760e736fc0b95b9 to your computer and use it in GitHub Desktop.
#!/bin/sh
ls -l *.gz | \
awk '
{
filename = $9;
"date +%s"|getline current_timestamp;
split(filename,components,"-");
timestamp=components[1];
if((timestamp + 6*60*60) < current_timestamp){
printf "%s %s\n", timestamp, filename
}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment