# Retrieving deleted and old files

Box Backup makes old versions of files and files you have deleted available, subject to there being enough disc space on the server to hold them.

This is how to retrieve them using `bbackupquery`. Future versions will make this far more user-friendly.

Firstly, run `bbackupquery` in interactive mode. It behaves in a similar manner to a command line sftp client.

    /usr/local/bin/bbackupquery

Then navigate to the directory containing the file you want, using `list`, `cd` and `pwd`.

    query > cd home/profiles/USERNAME

List the directory, using the "o" option to list the files available without filtering out everything apart from the current version. (if you want to see deleted files as well, use `list -odt`)

    query > list -ot
    00000078 f--o- 2004-01-21T20:17:48 NTUSER.DAT
    00000079 f--o- 2004-01-21T20:17:48 ntuser.dat.LOG
    0000007a f--o- 2004-01-21T17:55:12 ntuser.ini
    0000007b f---- 2004-01-12T15:32:00 ntuser.pol
    0000007c -d--- 1970-01-01T00:00:00 Templates
    00000089 -d--- 1970-01-01T00:00:00 Start Menu
    000000a0 -d--- 1970-01-01T00:00:00 SendTo
    000000a6 -d--- 1970-01-01T00:00:00 Recent
    00000151 -d--- 1970-01-01T00:00:00 PrintHood
    00000152 -d--- 1970-01-01T00:00:00 NetHood
    00000156 -d--- 1970-01-01T00:00:00 My Documents
    0000018d -d--- 1970-01-01T00:00:00 Favorites
    00000215 -d--- 1970-01-01T00:00:00 Desktop
    00000219 -d--- 1970-01-01T00:00:00 Cookies
    0000048b -d--- 1970-01-01T00:00:00 Application Data
    000005da -d--- 1970-01-01T00:00:00 UserData
    0000437e f--o- 2004-01-24T02:45:43 NTUSER.DAT
    0000437f f--o- 2004-01-24T02:45:43 ntuser.dat.LOG
    00004380 f--o- 2004-01-23T17:01:29 ntuser.ini
    00004446 f--o- 2004-01-24T02:45:43 NTUSER.DAT
    00004447 f--o- 2004-01-24T02:45:43 ntuser.dat.LOG
    000045f4 f---- 2004-01-26T15:54:16 NTUSER.DAT
    000045f5 f---- 2004-01-26T15:54:16 ntuser.dat.LOG
    000045f6 f---- 2004-01-26T16:54:31 ntuser.ini

(this is a listing from a server which is used as a Samba server for a network of Windows clients.)

You now need to fetch the file using it's ID, rather than it's name. The ID is the hex number in the first column. Fetch it like this:

    query > get -i 0000437e NTUSER.DAT
    Object ID 0000437e fetched successfully.

The object is now available on your local machine. You can use `lcd` to move around, and `sh ls` to list directories on your local machine.

© Ben Summers, 2003, 2004