User Tools

Site Tools


public:add_undelete_feature_to_your_home_directory

This is an old revision of the document!


Add "undelete" feature to your home directory

  1. Set up your system in such a way that your home directory is covered by BTRFS.
  2. Setup Snapper 1).
  3. Setup your system in such a way that snapshots are available under /home/.snapshots
  4. 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

#!/bin/bash
echo Undeleting "$1"...
cp -ir /home/.snapshots/$(ls -1 /home/.snapshots/ | tail -1)/snapshot/$(echo $(pwd)| cut -d '/' -f 3-)/$1 ./
public/add_undelete_feature_to_your_home_directory.1452718259.txt.gz · Last modified: 2018/03/31 00:38 (external edit)