Skip to content

Instantly share code, notes, and snippets.

View billmn's full-sized avatar

Davide Bellini billmn

  • Logistic Design
  • Mantova ( Italy )
  • 03:18 (UTC +02:00)
  • X @billmn
View GitHub Profile
@billmn
billmn / .env
Created February 18, 2022 08:45
Craft CMS: DB Backup command using Homebrew
# Backup/Restore commands
BACKUP_COMMAND="/opt/homebrew/bin/mysqldump -h localhost -u root -p --add-drop-table --comments --create-options --dump-date --no-autocommit --routines --set-charset --triggers --single-transaction --no-data --result-file=\"{file}\" {database} && /opt/homebrew/bin/mysqldump -h localhost -u root -p --add-drop-table --comments --create-options --dump-date --no-autocommit --routines --set-charset --triggers --no-create-info --ignore-table={database}.assetindexdata --ignore-table={database}.assettransformindex --ignore-table={database}.cache --ignore-table={database}.sessions --ignore-table={database}.templatecaches --ignore-table={database}.templatecachecriteria --ignore-table={database}.templatecacheelements --ignore-table={database}.templatecachequeries {database} >> \"{file}\""
RESTORE_COMMAND="/opt/homebrew/bin/mysql -h localhost -u root -p {database} < \"{file}\""