BackupPC-users

Re: [BackupPC-users] Restore recursive selective files

2010-04-22 10:04:23
Subject: Re: [BackupPC-users] Restore recursive selective files
From: Andy Brown <andy AT onyx DOT net>
To: "'General list for user discussion, questions and support'" <backuppc-users AT lists.sourceforge DOT net>
Date: Thu, 22 Apr 2010 15:01:40 +0100

Michael Stowe wrote at about 06:58:55 -0500 on Thursday, April 22, 2010:
 >>
 >> I think I'd be inclined to simply create a tar file for each machine, then
 >> extract the necessary files from the command line.
 >>
>(I hate top posting! lol)

(Agreed, Unfortunately my work insist on Outlook/exchange, which horribly 
screws with quoting, so apologies now for my reply looking odd)

>That being said, it would be helpful to have a simple command line
>script that would allow one to restore an arbitrary list of files from
>one or more shares and/or hosts where the file list could include wild
>cards (similar to the usage in the *nix find routine).

>In fact the script should be pretty simple to write in perl using the
>native perl 'find' routine (on the mangled version of the paths) and
>hooking into the backuppc restore code to execute the restore.

>The hardest part would be in filling out the command line options to
>make such a script maximally flexible and goof-proof.

>I don't really have the time now to do it, but again it shouldn't be
>hard...


Agreed, This is how I solved it as needed this now and quickly, for the sake of 
completeness I'm pasting what I did. I might try and hack together the perl at 
some point when I have the panic of a floored server/restore complete!

On the backuppc host I did:
/usr/share/backuppc/bin/BackupPC_tarCreate -h myhost.server.com -n 122 -s 
"/users" '/' > /backups/backuppc/myserver.tar
mkdir untarred
cd untarred
tar --preserve-permissions --preserve-order --verbose -x -f ../myserver.tar 
--wildcards --no-anchored 'index.*'
(As I'm wanting all files with index.* extracting, which preserves permissions 
and directory structure)
tar pzcvf ../myserver_fixed.tar.gz .

Then scp the myserver_fixed.tar.gz over to the destination, untar and job done. 
I know there are lots of easier ways but this is clear and did the job at the 
time!

Cheers guys.

Andy


This message (and any associated files) is intended only for the use of the 
intended recipient(s) and may contain information that is confidential, subject 
to copyright or constitutes a trade secret. If you have received this message 
in error, please contact Onyx Group immediately by replying to the message and 
deleting it from your computer. Any content included in this mail does not 
necessarily reflect the views of The Onyx Group.

Onyx Group Ltd, Registered in England Registration Number: 5682619, VAT Number: 
884255494

Registered Office: Onyx House (Stockton), 9 Cheltenham Road, Portrack 
Interchange Business Park, Stockton-on-Tees, TS18 2AD.


------------------------------------------------------------------------------
_______________________________________________
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/

<Prev in Thread] Current Thread [Next in Thread>