Results 1 to 3 of 3

Thread: Cannot restore deleted directory using rdiff-backup

  1. #1
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    4,384
    Distro
    Ubuntu 16.04 Xenial Xerus

    Question Cannot restore deleted directory using rdiff-backup

    I have carefully made daily backups using rdiff-backup, so in the case of needing to restore I can do so.

    But.

    I deleted a directory yesterday, and made a backup in the evening. Therefore, the directory is not in the latest mirror, but in the incremental backup from yesterday.

    Now I need to restore the directory. But I cannot figure out how to!

    I can see the directory in yesterday's incremental backup; i.e., the following works:
    Code:
    sudo rdiff-backup --list-at-time 1D [backupdir] [nameofdir]
    where [backupdir] is the backup (mirror) directory, and [nameofdir] is the name of the directory I'm trying to restore.

    So, I have tried to restore. This is the type of thing I have tried:
    Code:
    sudo rdiff-backup --restore-as-of 1D --include-globbing-filelist to-restore.lst [backupdir] [restoredir]
    where to-restore.lst holds the name of the directory to restore (in rdiff-backup's format) and [restoredir] is where I want the restored directory to go to.

    But, I get errors like:
    Code:
    Fatal Error: Fatal Error: The file specification
        '/home/paddy/[nameofdir]/'
    cannot match any files in the base directory
        '/home/paddy/[restoredir]'
    Useful file specifications begin with the base directory or some
    pattern (such as '**') which matches the base directory.
    Well, obviously the file specification doesn't exist in the [restoredir]. That's because I'm trying to restore it! If I try to create an empty directory first, it complains:
    Code:
    Fatal Error: Restore target /home/paddy/[restoredir] already exists, specify --force to overwrite.
    Please help. How do I restore a deleted directory from a previous day's backup to a designated destination?
    Last edited by Paddy Landau; May 17th, 2011 at 11:07 PM.
    Full system encryption with dual-bootFull Circle MagazineProblems with WINE?
    In my day, we had the outdoors in which to run, play, and socialise. Now people use computers for that.

  2. #2
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    4,384
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Cannot restore deleted directory using rdiff-backup

    Bump...

    Maybe there is a tutorial on restoring with rdiff-backup somewhere? I have Googled without success.
    Full system encryption with dual-bootFull Circle MagazineProblems with WINE?
    In my day, we had the outdoors in which to run, play, and socialise. Now people use computers for that.

  3. #3
    Join Date
    May 2008
    Location
    United Kingdom
    Beans
    4,384
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Cannot restore deleted directory using rdiff-backup

    Ah, I've found the answer. Two answers, actually.

    The very slow way: archfs

    • Install archfs.
    • Mount your backup:
      Code:
      sudo archfs [mountpoint] [repository]
    • Now, you can browse your backup (as root) to find what you want; and you can copy it to where you want.
    • Having restored, everything will be read-only and belong to root, so you will have to use chown and chmod.

    Pros: Visual (you can use Nautilus). Each version is displayed in an appropriately-named directory, so you can simply browse.

    Cons: Slow. Very slow. (It took several minutes to load my backup. Changing directories within the virtual drive takes a long time. (However, I have many versions; if you have a very fast computer or few versions it should be reasonably fast.)) After restoring you need to chown and chmod; the original permissions and ownership are lost. Remember to start Nautilus with gksu.

    The fast way: CLI

    I had misunderstood the requirements. The format is:
    Code:
    sudo rdiff-backup --restore-as-of [time] [repository]/[directorytorestore] [targetdirectory]
    Pros: Fast. Restores permissions and ownership.

    Cons: Not visual; you need the command line interface (CLI).
    Full system encryption with dual-bootFull Circle MagazineProblems with WINE?
    In my day, we had the outdoors in which to run, play, and socialise. Now people use computers for that.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •