How To Set Drush Backup Directory
Asked Answered
A

2

5

I just wanted to ask the question of how to set the Drush backup directory in drushrc.php. The result being that you can save your Drush archive-dump, ard, arb etc. where you want, rather than in the default ~/drush-backups/* directory. Yes you can do this with the --destination flag, but lets be honest that's pretty annoying if you just want to save in the same place all the time.

Aerophone answered 12/11, 2014 at 4:21 Comment(0)
A
8

This took me hours to figure out embarrassingly, so I just wanted to share this with anyone looking for this in the future as I could not find a single answer to this anywhere at the time. You just need to set the 'backup-dir' option in your drushrc.php like this:

$options['backup-dir'] = '/your/new/backup-dir';

Note no trailing slash.

I hope someone else finds this useful.

Aerophone answered 12/11, 2014 at 4:27 Comment(2)
I'm not sure when this changed but in Drush 8, you can simply edit these two lines in your drushrc.php file: $options['result-file'] = TRUE; $options['result-file'] = '/some/path/backups/@[email protected]';Nkvd
@RonCollins this is the setting for the sql-dump command, not ARD. I think, CodeNinja means the ARD. - edit: just tested, $options['backup-dir'] = '/your/new/backup-dir'; is working for ARD. Only a folders ads some data /archive-dump/20170517121357/[mydbname].20170517_121358.tar.gzEighth
R
0

For drush v9 upwards then add this to drush.yml

drush:
  paths:
    backup-dir: /your/new/backup-dir
Rosaceous answered 19/1, 2021 at 15:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.