Timeshift & Similar Solutions - Safeguard & Recover Your Linux

charlie.corder

Active Member
Joined
May 25, 2019
Messages
70
Reaction score
180
Credits
665
@wizardfromoz @Condobloke

Just did a system restore with Timeshift.
Everything went well and restored all my personal folders, documents, pics etc. in addition to the OS.
Every time I do something with the cp I learn something I did not know before {or had forgotten}.
This time it was to make sure I use a more current TS save. The one I used to restore was a week old. Argh! Some of my latest entries were gone. Not to worry though, as I have learned my lesson for the day. LOL.
OG
TC
 


zfigz

New Member
Joined
Aug 4, 2022
Messages
18
Reaction score
5
Credits
190
just to followup, i went with the following setup to store my timeshift snapshots remotely with the ability of restoring if my computer were to disappear/explode/etc:

1) manual cron for timeshift (except for backup snapshots)
Bash:
❯ cat /etc/cron.d/timeshift-hourly
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=""

30 * * * * root pgrep -lf python | grep borg >/dev/null; [[ $? -ne 0 ]] && timeshift --check --scripted
you'll noticed that i'm checking to see if borg is running or not.

2) manual cron for borg, again similar to above, checking to see if timeshift is running
Bash:
❯ if [[ $(pidof timeshift | wc -w) && $(pidof sleep | wc -w) == 0 ]]; then
    info "Starting backup with $BORG to $uri"
    $BORG create \
      --lock-wait 5 \
      --verbose \
      --filter AME \
      --list \
      --stats \
      --show-rc \
      --compression lz4 \
      --exclude-caches \
      "$uri"::"$name-$date" \
      /media/blah/timeshift/timeshift/**
    info "Pruning repository"
    $BORG prune \
      --list \
      --prefix "$name-" \
      --show-rc \
      $prunning \
      "$uri"
  else
    info "Timeshift is running or is about to run, exiting..."
    exit 1
  fi

3) and finally, i also created an image of my drive / stored it to borg. this is something that i'll do every 3-6 months to ensure i can restore using a timeshift snapshot.
 
OP
wizardfromoz

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
7,522
Reaction score
6,361
Credits
26,640
cron and borg are beyond my paygrade, but if it works for you, that's fine :)
 

zfigz

New Member
Joined
Aug 4, 2022
Messages
18
Reaction score
5
Credits
190
heh, well the plan was always for a remote copy to exist, just wish i didn't have to make the image for it all to work oh well ¯\_(ツ)_/¯
 
OP
wizardfromoz

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
7,522
Reaction score
6,361
Credits
26,640
Don't worry, we have a Brains Trust here, some of whom make me look like a pre-schooler, so if any of them has a better idea, or input for you, they'll swing by. :)

... and thanks for the update.
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Staff online

Members online


Top