Skip to content

Instantly share code, notes, and snippets.

@iamstoick
Last active February 26, 2017 21:58
Show Gist options
  • Select an option

  • Save iamstoick/2a7050039b6e9a0d5af0a52141c2fef5 to your computer and use it in GitHub Desktop.

Select an option

Save iamstoick/2a7050039b6e9a0d5af0a52141c2fef5 to your computer and use it in GitHub Desktop.
A Drush snippet on how to backup Drupal database and compress it after.

drush sql-dump --gzip --result-file=/path/to/target/[DATABASE_NAME]-$(date +%Y-%m-%d-%H.%M).sql

Remove all caches

drush sql-dump --gzip --skip-tables-list=cache,cache_* --result-file=/path/to/target/[DATABASE_NAME]-$(date +%Y-%m-%d-%H.%M).sql

Just changed the [DATABASE_NAME] with your database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment