Export database via Drush

Rating: 
+1
+150
-1
Clone this Snippet
From the command line, go to your sites/default folder or user drush aliases and type:
#from sites/default
drush sql-dump > backup_file_name-$(date +"%m-%d-%Y-%H-%M-%S").sql
 
#with drush aliases @sitename
drush @sitename sql-dump > backup_file_name-$(date +"%m-%d-%Y-%H-%M-%S").sql
Category: 
DrupalBash
Drupal Version: 
678
Drupal Category: 
Database/SQLDrush