Attached patch gives the user the option to exclude a top-level file/folder from the tarball.

CommentFileSizeAuthor
backup-exclude.patch1.83 KBahoeben

Comments

dmuth’s picture

Version: 5.x-1.x-dev » 5.x-2.x-dev

Thanks for the patch.

Before I implement it, I'm a bit unsure as to *why* we would want to exclude a specific folder from the backup. Can you elaborate on a use case?

Thanks,

-- Doug

ahoeben’s picture

Say for example you have a large temp-folder on your website you use to drop files for people to download, which has nothing to do with your Drupal installation. Or there's a whole subsite in the Drupal 'root' folder that has nothing to do with Drupal. I can also see this being useful if you just want to do a quick backup of the Drupal installation and db, but don't want to/need to include the full 'files' folder with - say - 8 Gb of video data (again).

diegogers’s picture

+1

borfast’s picture

I second ahoeben's comment.

For example, I have one website on the root of its domain and I have some other directories which are temporary sites for my clients to see. When I'm done, I'll delete them and they're also just copies of the original sites, so I don't really want to have them in a backup of my site.

Add my vote to this patch :)

rtivel’s picture

Version: 5.x-2.x-dev » 5.x-4.x-dev

Hi,

I am a relative drupal newbie, so please forgive what might seem like a basic question: how do I install the patch to exclude files/folders from backup. This is very important to me as I upload large files into a files/download directory for download by site users and I do not want to include them in the site backups.

Thanks in advance for your help ....

rtivel’s picture

I am using 5.x-4.x-dev and do not believe the patch works any longer. I am also using drupal 5.2. I noticed that the recent releases of the backup module have this note: "- Implemented a new mechanism for excluding files in a backup directory, courtesy of a suggestion from guenneguez_t." What is the new mechanism? Are there plans to incorporate a file/folder exclusion option in the module interface?

mightyiam’s picture

Would really love this to be implemented!

Petra’s picture

I tried your patch - it works with a few changes:
- I used functions.inc.php instead of backup_lib.php, cause in my version backup_lib.php is not included
- I added $exclude = preg_split("/[\s,]+/", strip_tags(variable_get("backup_exclude", '')));
in backup_get_files(&$file_list, $prefix_dir) {
before while ($file = readdir($fp)) {
cause $exclude is not defined

okeedoak’s picture

subscribing

tj2653’s picture

I would really like to see this feature in the next release too.

tj2653’s picture

[sorry, please delete]

Dimm’s picture

+1