In my Drupal installation folder, I have symlinks to external folders with 80+ GB of data. When I backup/update Drupal using Drush, Drush also archives the 80+ GB of data. How do I prevent Drush from backing up the contents of symlinks?

Also, when Drush restores the backup, the symlinks are not preserved as well. Drush replaces symlinks with the actual content. So after the backup/update of Drupal core is done, my Drupal installation folder ends up being too huge.

Can you please suggestion solution to both of the above problems? I am okay even if I have to write code to patch Drush or anything else. Just need help pointers in correct directions.

  • for temporary solution place the cron command in a shell script and run this command before it: chmod 000 external-older and this after it: chmod 755 external-folder.
    – AgA
    Jun 10, 2013 at 16:50
  • What version of drush are you running?. This was already fixed on Mar'12 drupal.org/node/1448538
    – jonhattan
    Jun 21, 2013 at 0:44
  • 1
    I guess it was 5.4. I will ask SysAdmin to update to the latest Drush and see if it is fixed. Thanks for pointing out! Jun 21, 2013 at 2:06
  • If drush team considered it a bug and fixed it, it's off-topic here, right?
    – Mołot
    Jun 21, 2013 at 7:30

2 Answers 2


This should probably be in the Drush issue queue. Maintainers can help you work through issues if you want to make a patch. Be sure you are using the latest version of Drush. By intention, it looks like Drush should only behave as you describe if the --dereference option is specified; without that, it should not follow and archive symlinks. Run Drush with --simulate to see what actual tar commands, etc. Drush is running. Post results and followup questions to the issue queue.


I found a way to exclude certain directories including symbolic links from Drush core update.

Since core update command does not provide a way to exclude directories. We should first take a routine backup of our Drupal site, and then ask Drush to run update in-place i.e. without taking additional backup. We need to add --no-backup option in Drush update command. This way symbolic links are preserved too!

We need to execute sequence of following two commands to update Drupal core containing symbolic links. You can just execute first command if you are only interested in taking backup of your Drupal site.

$ drush ard --tar-options="--exclude=symlinkfolder --exclude=.git" --root="/path/to/drupal/" -v     

$ sudo drush up drupal --no-backup --root="/path/to/drupal/" -v 

Not the answer you're looking for? Browse other questions tagged or ask your own question.