BackupPC-users

Re: [BackupPC-users] My problems with restore.

2011-08-31 19:23:27
Subject: Re: [BackupPC-users] My problems with restore.
From: Holger Parplies <wbppc AT parplies DOT de>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Thu, 1 Sep 2011 01:21:19 +0200
Hi,

Les Mikesell wrote on 2011-08-31 17:01:24 -0500 [Re: [BackupPC-users] My 
problems with restore.]:
> On Wed, Aug 31, 2011 at 3:13 PM, Joe Skop <joe.skop AT gmail DOT com> wrote:
> >>> - Download singolar files or folders, not bigger of 70/100 Mb (or the
> >>> download process hangs), transfer on the new instances and so like
> >>> before.
> >
> >>Hangs?  Is this a network problem?

it could be a full FS wherever the browser decides to temporarily store the
download (no, that's not where you tell it to save it to).

> > Yes, maybe some timeouts on the networks... I never investigate so
> > much about this not conventional problem.
> 
> The quick fix, regardless of the real problem, is probably to run the
> web browser on the backuppc server itself or some nearby machine with
> a good network connection and download a tar image of what you need
> through the browser.

Yes, maybe there's more tmp space there ;-).

> Then use whatever transfer method you think will
> be reliable to get the file where you want it and can to the tar
> extract.

That's what I like about the 'quick and easy solutions' instead of configuring
your system correctly: they're often neither quick nor easy, but you usually
don't notice until you've spent more time trying them than you would have
setting things up correctly in the first place ;-).

> >>> If I send the recovering via shell:
> >>>
> >>> /usr/bin/ssh -x -l USER localhost env LC_ALL=C /bin/tar -x -p
> >>> --numeric-owner --same-owner -v -f - -C /tmp
> >>> /usr/share/backuppc/bin/BackupPC_tarCreate -h SERVER_ORIG -n 134 -s
> >>> /mnt/dump -t -r /mysql -p /mysql/ /mysql/backup.log
> >>>
> >>> /bin/tar: You may not specify more than one `-Acdtrux' option
> >>> Try `/bin/tar --help' or `/bin/tar --usage' for more information.

Yes. tar is absolutely right.

> >>I don't understand what you are trying to do there.

I do, but it's not correct.

> > From the web interface, I select a host, "Backup browse for HOST", I
> > browse the folders, I select a example file, i press "Restore selected
> > files", I go to "Restore Options for HOST", I choose the 1st option
> > "Option 1: Direct Restore", I select "localhost" (that is the server
> > that hosts the backuppc", I choose the share and the dir.
> > Next screen "Are you sure?", the positions are:
> >
> > Original file/dir
> > HOST:/mnt/dump/mysql/backup.log
> >
> > Will be restored to
> > localhost:/tmp/mysql/backup.log
> > If I press "Restore", after a few seconds I have the message on the
> > Error: "restore failed: Tar exited with error 65280 () status".

As Les said, for that to work, you need to set up ssh access to localhost
(or whatever replacement host you want to use) in *exactly* the same way
as you did for the target host. This is not something you'd normally do
(unless, maybe, if you are backing up your BackupPC server), so you probably
haven't. If you had, it would probably work.

> > If I try manually, by shell, by the correct user etc etc, to do the
> > same commandline, I have the error " /bin/tar: You may not specify
> > more than one `-Acdtrux' opion ...".

Well, what you quoted above is not even *nearly* the same commandline. Look
again. (I'll admit I haven't seen a log file entry for a direct restore,
because I've never done one and don't intend to. If it should really look
like what you quoted above, then that's a bug. However, I'd be surprised if
that's the case.)

As Les has stated twice, you need to have something along the lines of

        BackupPC_tarCreate ... | ssh tar -x ...

(with the appropriate arguments and possibly paths to the commands). Simply
giving the BackupPC_tarCreate invocation as extraneous parameters to the
remote tar command is guaranteed to never do *anything* meaningful (let alone
what you want), because the '-t' option of BackupPC_tarCreate will confuse tar
(which has already seen the '-x' option). You can leave out the '-t' option if
you want to see a different error message (or possibly tar will just patiently
wait for a tar stream to extract). Or you could put together the correct
command. Chances are, it will be

        /usr/share/backuppc/bin/BackupPC_tarCreate -h SERVER_ORIG -n 134 -s 
/mnt/dump -t /mysql/backup.log | /usr/bin/ssh -x -l USER localhost /bin/tar -x 
-p --numeric-owner --same-owner -v -f - -C /tmp

but only if your quote was correct apart from the order. If you're wondering
why I left out the '-r' and '-p' arguments, it's because replacing '/mysql' by
'/mysql/' is pointless. Likewise, you'll probably understand tar's output
without LC_ALL=C (BackupPC might not). I could have changed 'ssh' into 'sudo'.
The point is, if you understand what the parts do, it's simple to rearrange
or modify them to do what you need. If you don't, you'll end up copying
something incorrectly and wondering why it doesn't work.

It's not really complicated. BackupPC_tarCreate creates a tar from the backup
from host SERVER_ORIG, number 134, share /mnt/dump, file(s) /mysql/backup.log.
'-t' makes it print summary totals. You don't need them, so you can remove
that if you want to. If you wanted more files/directories from that backup,
you could list all of them there just like '/mysql/backup.log'. If you want to
store the resulting tar file on the BackupPC server, just use output
redirection ("> /tmp/my_backuppc_restore.tar") instead of the pipe to ssh.
Or figure out why your browser download is not working ;-).

I hope the path you should follow is now more clear.

Regards,
Holger

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
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>