Skip to content

Instantly share code, notes, and snippets.

@niclashoyer
Created June 16, 2012 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niclashoyer/2940983 to your computer and use it in GitHub Desktop.
Save niclashoyer/2940983 to your computer and use it in GitHub Desktop.
Display gzipped SQL dumps from folder
#!/bin/bash
dir=/path/to/dumps
ending=sql.bz2
cd $dir
for file in *.$ending; do
time=$(date -d @`stat $file -c %Y` +%T)
size=$(du -sh $file | awk '{print $1}')
name=${file%%.$ending}
echo $name $size $time
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment