[Box Backup] Wanting to write a new program.
Scott McNee
boxbackup@fluffy.co.uk
Tue, 17 May 2005 08:32:49 +1000
Some of our sites may not have access to a suitable {link speed} or
{Linux/Unix} box to Restore any data that they have backed up. Where as =
A
DVD can be sent to site and restored directly to the windows machine if =
they
are in possession of the appropriate Decryption Keys.
Thank you for your Help.
I will see how I go.
Thanks.
-----Original Message-----
From: boxbackup-admin@fluffy.co.uk [mailto:boxbackup-admin@fluffy.co.uk] =
On
Behalf Of Ben Summers
Sent: Monday, 16 May 2005 7:51 PM
To: boxbackup@fluffy.co.uk
Subject: Re: [Box Backup] Wanting to write a new program.
On 16 May 2005, at 09:52, Scott McNee wrote:
> Hi All,
> Thankyou for writing a very complete backup system. I am=20
> interested in developing an addition to the existing system. I would=20
> like to develop a command line client for windows that will directly=20
> access a backup
> stored on disc/CD/DVD. i.e.. A copy of the Server directory for the
> username.
>
> Is there any information that you could provide to assist in this
> process.
> i.e.. pseudo code on accessing the file structures Directly?
There is plenty of actual code to look at! And some overview docs in=20
the notes directory.
The relevant code is in lib/backupstore and lib/backupclient. You can=20
easily create a new executable which includes these bits of code, look=20
in the modules.txt file.
Look in StoreStructure.h for functions to generate local filenames from=20
object IDs. Start by loading the root directory with ID=20
BACKUPSTORE_ROOT_DIRECTORY_ID as a BackupStoreDirectory (Use the=20
filename with a RaidFileRead stream, then use=20
BackupStoreDirectory::ReadFromStream() to load up the contents.) Then=20
go through the entries with a BackupStoreDirectory::Iterator, and=20
examine them. Recurse to other directories. To restore a file, use=20
BackupStoreFile::DecodeFile().
To set up the crypto so dirs and files can be decoded properly, use=20
BackupClientCryptoKeys_Setup(), given the keys file used to create the=20
data. To be able to use the RaidFile stuff, call=20
RaidFileController::GetController().Initialise() with the path to a=20
suitable configuration file, which you'll probably have to generate on=20
the fly given the location of the data on the CD.
There are some tests which show these principles. The tests are not=20
written to the same quality standards as the rest of the code.=20
test/backupstore is worth a look, even if most of the code communicates=20
with the server. (But bear in mind that the structures are all the=20
same, just downloaded from the server rather than loaded from the=20
disc.)
Finally, ask Nick for a copy of the source for the Win32 port, which=20
will make it easier to work under Windows. The RaidFile stuff won't=20
have been ported, and indeed some of it might not be possible given=20
that the write side of things relies on the way UNIX filesystems work.=20
But you should be able to get the RaidFileRead stuff to work.=20
Alternatively, if your server doesn't use the RaidFile in RAID mode (ie=20
just one disc in each set, not three) simply append ".rfw" and prepend=20
the root of the "RAID" files to the names given by the StoreStructure=20
utilities, and use a FileStream object instead. It'd be better to use=20
the proper interface, but you may have no choice under Win32. Maybe you=20
could use a special function to open the files, and later it could be=20
replaced by one which used the RaidFile interface properly?
I'm curious, why do you want this tool?
Ben
_______________________________________________
boxbackup mailing list
boxbackup@fluffy.co.uk
http://lists.warhead.org.uk/mailman/listinfo/boxbackup