User Tools

Site Tools


public:add_undelete_feature_to_your_home_directory

Differences

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

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
public:add_undelete_feature_to_your_home_directory [2016/01/13 20:50] – created fangfufupublic:add_undelete_feature_to_your_home_directory [2017/07/05 21:09] fangfufu
Line 1: Line 1:
 +====== Add "undelete" feature to your home directory ======
 +<note warning>This is obsolete, I no longer use Snapper</note>
 +  - Set up your system in such a way that your home directory is covered by BTRFS.
 +  - Setup Snapper [(Snapper -> https://wiki.archlinux.org/index.php/Snapper)].
 +  - Setup your system in such a way that snapshots are available under /home/.snapshots
 +  - Add the "undelete" script in your \$HOME/bin, make sure it is executable, and make sure \$HOME/bin is in your \$PATH. 
  
 +===== The "undelete" script =====
 +<code bash>
 +#!/bin/bash
 +echo Undeleting "$1"...
 +cp -ir /home/.snapshots/$(ls -1 /home/.snapshots/ | tail -1)/snapshot/$(echo $(pwd)| cut -d '/' -f 3-)/$1 ./
 +</code>