BackupPC-users

Re: [BackupPC-users] BackupPC_tarCreate with only certain types of files

2015-05-23 07:46:57
Subject: Re: [BackupPC-users] BackupPC_tarCreate with only certain types of files
From: Holger Parplies <wbppc AT parplies DOT de>
To: Timothy J Massey <tmassey AT obscorp DOT com>
Date: Sat, 23 May 2015 13:44:48 +0200
Hi,

Timothy J Massey wrote on 2015-05-22 20:40:52 -0400 [Re: [BackupPC-users] 
BackupPC_tarCreate with only certain types of?files]:
> Les Mikesell <lesmikesell AT gmail DOT com> wrote on 05/22/2015 04:24:56 PM:
> 
> > > What am I missing?  How do I get BackupPC_tarCreate to create a 
> > > tar file that contains all PDF's stored in that path?
> > > [...]
> > 
> > Can't help with BackupPC_tarCreate's wildcard concepts

I can: there are none. BackupPC_tarCreate gets a list of path names to include
in the tar. Each of these is looked up verbatim and included (with
substructure if it happens to be a directory).

> The problem is not that I couldn't figure out how to get the PDF's at all,
> but how I could avoid restoring 500GB of data for the 500*MB* I actually
> need!  :)

It should be *fairly* simple to patch BackupPC_tarCreate for the simple case
you need. A more general case would add an option and include correct handling
of hardlinks and symlinks. In sub TarWriteFile, after the calculation of
$tarPath and before the big file type "if" (line 455 in the 3.3.0 source),
I'd add

        return
          if $hdr->{type} != BPC_FTYPE_DIR and $tarPath !~ /\.pdf$/i;

(omit the "i" modifier if you really only mean lowercase "pdf"). Note that
this is once again completely untested ;-).

Hope that helps.

Regards,
Holger

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/