Closed (fixed)
Project:
Drush
Component:
Core Commands
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Feb 2012 at 20:13 UTC
Updated:
26 Jul 2012 at 18:31 UTC
Jump to comment: Most recent file
How to exclude ignore git folders on a Drush adb archive dump backup?
currently when i do a drush adb, it tar's up everything in the folders even the git folders, which make it alot bigger than it should be.
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | drush-tar-options-1430482-19.patch | 4.79 KB | jamesharv |
| #13 | drush-tar-options-1430482-13.patch | 4.2 KB | jamesharv |
| #10 | drush-tar-options-10.patch | 4.5 KB | greg.1.anderson |
| #6 | drush-tar-options.patch | 3.37 KB | janusman |
Comments
Comment #1
moshe weitzman commentednot currently supported.
Comment #2
dman commentedI'm getting the same. I'm trying to learn from the archive-dump approach (and similar current discussions on interoperability of site dumps).
I've got .svn stuff that chews up the processor with all the little files for *every single folder*
On top of that, There are a few other places I'd like to exclude from the packager, just to be practical.
files/backup_migrate for one.
files/imagecache for two (the transferred site can rebuild them, thankyou)
files/tmp.
and surely more. (some of the folk in teams that came before me dropped sql dumps in unlikely places within the site)
So, in a similar way to how we easily wedged in ssh-options a while ago, #686384: Allow the site-aliases configs to define extra options when invoking ssh
I think we will be able to wedge in a bunch of exclusions in ... um ... --tar-options ?
It looks that the current code uses tar (-r = --append) a lot. I had a similar handmade script that copied everything into a temp folder then tarred at the end, so my use of those flags is not identical with the way I'm trying to follow by using archive-dump. Still, looks very do-able. And may cut the processing/tarring/zipping time that I'm seeing down to a quarter.
Comment #3
dman commentedI can do a patch for this pretty easy, if I can get a "sure, why not?" from the team.
Comment #4
patoshi commenteda patch would be great! is it a modification when you tar recursively?
Comment #5
dman commentedI'll stick this in my todo next time I'm working with dumps and custom drush stuff. Won't be too long.
The options will be just the same as normally get passed to tar, they will go through verbatim, so something like
drush archive-dump --tar-options="--exclude=.git --exclude=.svn" @sitenamewould be normal.
Then you get to put that option into drushrc.php under the command-options as needed.
Comment #6
janusman commentedHow about this?
This implements --tar-options just as mentioned in #5.
Comment #7
greg.1.anderson commentedLooks pretty good to me.
Comment #8
dman commentedBravo - nice and small and tidy.
Comment #9
moshe weitzman commentedThat looks good. It would be even cooler if one could use tokens like %files (see example.aliases.drushrc.php for more about tokens). Is this easily done, Greg?
Comment #10
greg.1.anderson commentedCan't drive this to completion right now, but here's a patch that should mostly work. Does not support %modulename, but %files and %modules and %themes are supported.
Comment #11
moshe weitzman commentedI think this is good enough to commit. We should add an Example which shows how to use %files.
Comment #12
moshe weitzman commentedNot applying cleanly for me.
Comment #13
jamesharv commentedThis is going to be really useful for me on a current project, so I've updated the patch so that it applies cleanly against current master. Hope that helps.
Comment #14
skwashd commentedI've played with the patch from #13 against a fresh git clone and it works as expected.
Comment #15
greg.1.anderson commentedTrivial point, but this patch is still missing the example requested in #11. Other than that, looks okay to me.
Comment #16
jonhattanNote the existance of ‘--exclude-vcs’ in recent versions of tar. http://www.gnu.org/software/tar/manual/html_section/exclude.html
Comment #17
skwashd commented@jonhattan CentOS/RHEL 5 doesn't support and right now one of my big clients is stuck with that for their environment. We also want to exclude css, js and some other paths from files/ in our archive. I think @JamesHarv's patch covers both of those.
Marking as needs work based on #15.
Disclaimer: I work with @JamesHarv.
Comment #18
jonhattanMine was just a note in the aim to just document its existance. It would be fine to add it as a command example but I can live without that. Beyond that I'm fine with current patch.
blame centos btw :p
Comment #19
jamesharv commentedHere's a patch which includes an example of using the %files placeholder in --tar-options (Addressing #15).
Comment #20
skwashd commented#19 looks good to me and has the extra example.
Comment #21
greg.1.anderson commentedCommitted; thanks.