+/*
+ Bacula® - The Network Backup Solution
+
+ Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+
+ The main author of Bacula is Kern Sibbald, with contributions from
+ many others, a complete list can be found in the file AUTHORS.
+ This program is Free Software; you can redistribute it and/or
+ modify it under the terms of version three of the GNU Affero General Public
+ License as published by the Free Software Foundation and included
+ in the file LICENSE.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+
+ Bacula® is a registered trademark of Kern Sibbald.
+ The licensor of Bacula is the Free Software Foundation Europe
+ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+ Switzerland, email:ftf@fsfeurope.org.
+*/
/*
* Old style
*
* Kern E. Sibbald, December MMI
*
*/
-/*
- Copyright (C) 2001-2005 Kern Sibbald
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- version 2 as amended with additional clauses defined in the
- file LICENSE in the main source directory.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- the file LICENSE for additional details.
-
- */
#include "bacula.h"
#include "find.h"
+#include "ch.h"
-#include <pwd.h>
-#include <grp.h>
#include <sys/types.h>
#ifndef FNM_LEADING_DIR
int
-match_files(JCR *jcr, FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt, bool), void *his_pkt)
+match_files(JCR *jcr, FF_PKT *ff, int file_save(JCR *, FF_PKT *ff_pkt, bool))
{
- ff->callback = callback;
+ ff->file_save = file_save;
struct s_included_file *inc = NULL;
bstrncat(ff->VerifyOpts, inc->VerifyOpts, sizeof(ff->VerifyOpts));
Dmsg1(100, "find_files: file=%s\n", inc->fname);
if (!file_is_excluded(ff, inc->fname)) {
- if (find_one_file(jcr, ff, callback, his_pkt, inc->fname, (dev_t)-1, 1) ==0) {
+ if (find_one_file(jcr, ff, file_save, inc->fname, (dev_t)-1, 1) ==0) {
return 0; /* error return */
}
}
case 'A':
inc->options |= FO_ACL;
break;
- case 'Z': /* gzip compression */
- inc->options |= FO_GZIP;
- inc->level = *++rp - '0';
- Dmsg1(200, "Compression level=%d\n", inc->level);
+ case 'Z': /* compression */
+ rp++; /* skip Z */
+ if (*rp >= '0' && *rp <= '9') {
+ inc->options |= FO_COMPRESS;
+ inc->algo = COMPRESS_GZIP;
+ inc->level = *rp - '0';
+ }
+ else if (*rp == 'o') {
+ inc->options |= FO_COMPRESS;
+ inc->algo = COMPRESS_LZO1X;
+ inc->level = 1; /* not used with LZO */
+ }
+ Dmsg2(200, "Compression alg=%d level=%d\n", inc->algo, inc->level);
break;
case 'K':
inc->options |= FO_NOATIME;
break;
+ case 'X':
+ inc->options |= FO_XATTR;
+ break;
default:
Emsg1(M_ERROR, 0, _("Unknown include/exclude option: %c\n"), *rp);
break;
{ }
next->next = inc;
}
- Dmsg1(50, "add_fname_to_include fname=%s\n", inc->fname);
+ Dmsg4(100, "add_fname_to_include prefix=%d compres=%d alg= %d fname=%s\n",
+ prefixed, !!(inc->options & FO_COMPRESS), inc->algo, inc->fname);
}
/*
*/
if (inc) {
ff->flags = inc->options;
- ff->GZIP_level = inc->level;
+ ff->Compress_algo = inc->algo;
+ ff->Compress_level = inc->level;
}
return inc;
}