Skip to content

Instantly share code, notes, and snippets.

@phamquocbuu
Created August 14, 2018 08:41
Show Gist options
  • Select an option

  • Save phamquocbuu/47de1666ce64ac5545cc07d01f77ad68 to your computer and use it in GitHub Desktop.

Select an option

Save phamquocbuu/47de1666ce64ac5545cc07d01f77ad68 to your computer and use it in GitHub Desktop.
GUnzip and import latest database file
find /PATH/ -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2 | tail -n 1 | xargs gunzip ;
find /PATH/ -type f -printf "%T@ %p\n" | sort -n | cut -d' ' -f 2 | tail -n 1 | perl -pe 'chomp' | xargs cat | mysql -u DB_USER DB_NAME ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment