User Tools

Site Tools


backup

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
backup [2026/06/19 08:26] userabackup [2026/06/19 09:14] (current) usera
Line 125: Line 125:
  
 More infos can be found [[https://restic.readthedocs.io/en/stable/050_restore.html|here]]. More infos can be found [[https://restic.readthedocs.io/en/stable/050_restore.html|here]].
- 
-<WRAP classes #id width :language> 
-"big" content 
-</WRAP> 
- 
- 
  
 First, you can see the existing snapshots in your backup folder by entering: First, you can see the existing snapshots in your backup folder by entering:
Line 136: Line 130:
 <code> restic -r /path/to/your/backup/folder snapshots </code> <code> restic -r /path/to/your/backup/folder snapshots </code>
  
-<pre>(base) <span style="color:#26A269"><b>usera@usera-computer1</b></span>:<span style="color:#12488B"><b>~/Downloads</b></span>$ restic -r testdir snapshots +which will give the following output: 
-enter password for repository:  + 
-wrong password or no key found. Try again +<pre>enter password for repository: 
-enter password for repository: +
 repository 7d765fa4 opened (repository version 2) successfully, password is correct repository 7d765fa4 opened (repository version 2) successfully, password is correct
 ID        Time                 Host             Tags        Paths ID        Time                 Host             Tags        Paths
 ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
-9e4378a4  2026-06-19 10:15:59  usera-computer1              /home/usera/Downloads/testdir2+9e4398a4  2026-06-19 10:15:59  your-computer-name              /path/to/the/folder/you/backuped
 ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
 1 snapshots 1 snapshots
 </pre> </pre>
  
 +Note that you need to know your password to do this, as all backups made by restic are encrypted. Pick up the ID of the snapshot you want to restore, for example in our case ''9e4398a4''
  
 +To see all files in this snapshot, enter:
  
 +<code> restic -r /path/to/your/backup/folder ls snapshot_id </code>
  
-==== If you need to restore a snapshot ==== +which will give the following output
- +<pre>restic -r testdir ls 9e4398a4 
- +enter password for repository:  
- +repository 7d767fa4 opened (repository version 2) successfullypassword is correct 
-Once this is done, you can do another backup of your /home, which contains all your regular files. For this you can use the software backintime. You can install it with+snapshot 9e4398a4 of [/path/to/the/folder/you/backuped] filtered by [] at 2026-06-19 10:15:59.284838644 +0200 CEST): 
-<code> +/testdir2 
-sudo apt install backintime-qt +/testdir2/hi</pre>
-</code> +
- +
- +
-Before launching itwe need to decrypt the encrypted disk, and mount the logical volume we intend to use: +
-<code> +
-sudo cryptsetup luksOpen /dev/sdb2 cryptsetup +
-sudo vgchange -ay +
-sudo mount /dev/mapper/vgbackup-home /mnt +
-</code> +
- +
-now everything written on /mnt on your computer will be written on your disk. +
- +
-You can then launch backintime with: +
-<code> +
-sudo backintime-qt +
-</code> +
- +
-you can then configure it to save things in /mnt: +
- +
-{{ ::backintime_1.png?600 |}} +
- +
- +
-{{ ::backintime_2.png?600 |}} +
- +
- +
-{{ ::backintime_3.png?600 |}} +
- +
-And then click on "Take snapshot" and wait for it to finish:+
  
-{{ ::backintime_4.png?600 |}}+if you would like to restore the whole snapshot to a specific directory, enter:
  
-you can then unmount and remove your backup disk:+<code>restic -r /srv/restic-repo restore 9e4398a4 --target /path-to-the/place/you/want/to/restore/to </code> 
 +<pre>enter password for repository: 
 +restoring snapshot of [/home/user/work] at 2015-05-08 21:40:19.884408621 +0200 CEST to /tmp/restore</pre>
  
-<code> +It is possible to restore only a folder or file by changing ''snapshot_id'' to ''snapshot_id:/path/to/folder/or/file'' in the above expression
-sudo umount /mnt +
-sudo vgchange -an vgbackup +
-sudo cryptsetup luksClose cryptodisk +
-</code>+
  
backup.1781857595.txt.gz · Last modified: by usera