On http://hostN.ws.nsrc.org/backuppc, we are going to restore using create/write permissions
Select Host summary
in the Server menu on the left, then click on localhost
From Edit config
, click on the "xfer" tab :
Change the content of 'TarClientRestoreCmd' label :
From
$sshPath -q -x -l root $host env LC_ALL=C $tarPath -x -p --numeric-owner --same-owner -v -f - -C $shareName+
to
/usr/bin/sudo LC_ALL=C $tarPath -x -p --numeric-owner --same-owner -v -f - -C $shareName+
Don't forget to save it.
On shell (terminal - command line), we are going to give to the backup user permission to create directory:
$ sudo visudo
Add this line at the end of file:
backup ALL=NOPASSWD: /bin/mkdir
$ ls -l DESTINATION_PATH
Let's start by deleting a file we will restore.
On the host you are backinup (hostY
), go to the /var/www/html
directory, and remove the file index.html
$ cd /var/www/html
$ sudo rm index.html
Oops! :) It's time to restore that file!
http://hostN.ws.nsrc.org/backuppc
Note: instructions below are taken from http://backuppc.sourceforge.net/faq/BackupPC.html
Let's restore from the last backup.
Select Host summary
in the Server menu on the left, then click on hostY
From hostY Backup Summary
, click on the backup number to restore. You can navigate the shares and directory tree for that backup
BackupPC's CGI interface automatically fills incremental backups with the corresponding full backup, which means each backup has a filled appearance. Therefore, there is no need to do multiple restores from the incremental and full backups: BackupPC does all the hard work for you. You simply select the files and directories you want from the correct backup vintage in one step.
You can download a single backup file at any time simply by selecting it. Your browser should prompt you with the file name and ask you whether to open the file or save it to disk.
Alternatively, you can select one or more files or directories in the currently selected directory and select "Restore selected files". (If you need to restore selected files and directories from several different parent directories you will need to do that in multiple steps.)
In our case, navigate to /var/www/html
and check the box for index.html
.
If you select all the files in a directory, BackupPC will replace the list of files with the parent directory.
Then click Restore selected files
You will then be presented with a screen that has three options:
With this option the selected files and directories are restored directly back onto the host, by default in their original location. Any old files with the same name will be overwritten, so use caution. You can optionally change the target host name, target share name, and target path prefix for the restore, allowing you to restore the files to a different location.
Once you select "Start Restore" you will be prompted one last time with a summary of the exact source and target files and directories before you commit. When you give the final go ahead the restore operation will be queued like a normal backup job, meaning that it will be deferred if there is a backup currently running for that host. When the restore job is run, smbclient, tar, rsync or rsyncd can be used (depending upon $Conf{XferMethod}) , but in your case, let set it to "rsync", to actually restore the files.
With this option a zip file containing the selected files and directories is downloaded. The zip file can then be unpacked or individual files extracted as necessary on the host machine. The compression level can be specified. A value of 0 turns off compression.
When you select "Download Zip File" you should be prompted where to save the restore.zip file.
BackupPC does not consider downloading a zip file as an actual restore operation, so the details are not saved for later browsing as in the first case. However, a mention that a zip file was downloaded by a particular user, and a list of the files, does appear in BackupPC's log file.
This is identical to the previous option, except a tar file is downloaded rather than a zip file.
If you selected a Direct Restore
, go to /var/www/html
on hostY
, and verify that index.html
has been restored!