Timeshift & Similar Solutions - Safeguard & Recover Your Linux

charlie.corder

Well-Known Member
Joined
May 25, 2019
Messages
108
Reaction score
275
Credits
1,038
@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
8,937
Reaction score
7,909
Credits
37,595
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
8,937
Reaction score
7,909
Credits
37,595
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.
 
OP
wizardfromoz

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
8,937
Reaction score
7,909
Credits
37,595
Just a heads up to @zfigz and regrets on the delay in replying.

I have ended up relegating Pop!_OS to a Guest on a Virtual Machine on one of my Linux Distros and so

I can install it again - it will be easier the 2nd time around for me to restore my setup from how it wrests control from Grub now that I know the steps.

... is not likely to happen any time soon. If I do take it on again with a full install, and succeed with Timeshift, I will report back here.

Wizard
 
OP
wizardfromoz

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
8,937
Reaction score
7,909
Credits
37,595
Over the next few days, I will be dealing with a phenomenon you may or may not have experienced, and that is with the GUI (Graphical User Interface, that is, point and click) aspect of Timeshift falling over before completing its task, and compromising whatever that task was, namely
  • creating a snapshot
  • deleting a snapshot
  • restoring from a snapshot
Don't hit the panic buttons yet - it only affects certain Distros that use a specific version of a specific package, and there are workarounds.

First I will deal with a specific case, for one of our Members who uses Debian Sid, which is the unstable/untested version of Debian, and so not likely a Distro many of you use.

Once I have covered that, I will move on to the general Linux population that many of you comprise.

In the meantime, if you wish, you can get some background by reading the following Thread, which we have basically completed.

https://www.linux.org/threads/solved-kinetic-kudu-possible-problems-with-timeshift-gui.42321/

Cheers

Wizard
 
OP
wizardfromoz

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
8,937
Reaction score
7,909
Credits
37,595
@Oldhabbits - Eddy, hi.

I installed Debian Sid, which had the "guilty as charged" version 2.74 of libglib2.0-0, and as expected, Timeshift experienced the symptomatic belly ache.

I went to Tony George's old site (now archived), at https://github.com/teejee2008/Timeshift/releases and as he does not have a .deb file for the new Timeshift there, downloaded the .tar.gz source package and installed it.

I have not compiled from source very often (a weakness I need to address) and struggled with a bit of dependency hell as an outcome, but eventually got it, or so I hoped.

My notes (11 pages of them, containing output) are summarised with just the few lines below

SUMMARY FOR OLDHABBITS

Download source code timeshift-22.06.6.tar.gz from

https://github.com/teejee2008/Timeshift/releases

and extracted it.

sudo apt-cache search valac

sudo apt install valac

sudo apt install libgee-0.8-dev

sudo apt install libvte-2.91-dev

sudo apt install libjson-glib-dev

And then, from inside the Timeshift (extracted) folder in Downloads

make all
sudo make install

Then test the product.

This allowed me to run Timeshift GUI to completion, generating a snapshot maybe 8 GB in size, complete with comments.

Of course, a system restore product is of no use if it cannot restore a system, so I blew away Sid and attempted to restore from the Snapshot.

That operation failed. You may have more luck than I, because of greater knowledge of both Sid, and compiling from source, but for now, I may have to give it a break.

I note, however, from the other Thread, that you are familiar with the CLI side of Timeshift, so you may wish to continue with that until an updated version of Timeshift makes its way into Sid's repositories. I'll leave that to you.

Cheers

Wizard
 

Oldhabbits

Member
Joined
May 24, 2021
Messages
88
Reaction score
59
Credits
595
My notes (11 pages of them, containing output) are summarised with just the few lines below

@wizardfromoz Hi Wizard,

Thank you a million for your research into my debian - timeshift problem !!!!
I will sure test it out, somewhere tomorrow, dedicating the necessary time into it...
If I succeed, I will report back ;-)

Thanks again,

Eddy
 

Oldhabbits

Member
Joined
May 24, 2021
Messages
88
Reaction score
59
Credits
595
@wizardfromoz Hi Wizard,

Yes, all your instructions went well and we did it ! :)
Timeshift is once again in working order, tried to make a new backup, restored the backup after changing something on my system and erased an already pre-made backup from the list. No errors, no crashes ! ;)
Thanks again for your efforts...

Cheers,

Eddy
 
OP
wizardfromoz

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
8,937
Reaction score
7,909
Credits
37,595
That's great news, and you are welcome, Eddy.

Enjoy your Linux ;)

Wiz
 
OP
wizardfromoz

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
8,937
Reaction score
7,909
Credits
37,595
Thanks Paul, but nicely done Tony George, author of Timeshift. :)
 

VP9KS

Well-Known Member
Joined
Apr 29, 2017
Messages
813
Reaction score
786
Credits
1,709
You are much too humble, young man! You have taken the time and effort to introduce us all to it, before we had even heard of it, and have been working tirelessly to assist others with it.:cool: So, I say again, nicely done Wiz!:)
 

g_admane

New Member
Joined
Dec 14, 2022
Messages
1
Reaction score
0
Credits
7
Simple answer is yes. Just did it yesterday on the new Peppermint OS.

Best suggestion is to ask me the same question at my thread here and I can go into more detail.

And remind us here and there what distro you are using.

I have less than an hour left online before I head off for my evening in Australia, but I can answer in more detail tomorrow.

Wiz
I want to move my ubuntu from my HDD to newly installed SSD. But i dont want to loose any of my customisations, settings,etc. Can i simply use timeshift snapshot to restore everything on a new fresh installation of ubuntu in SSD?

This is a dual boot system, SSD already has windows 10.
 
OP
wizardfromoz

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
8,937
Reaction score
7,909
Credits
37,595
G'day @g_admane and welcome to linux.org :)

I moved this post from the other Thread you were visiting, so that more can benefit.
Can i simply use timeshift snapshot to restore everything on a new fresh installation of ubuntu in SSD?

Yes. Just be sure you do a couple of things:

1. Put in place a Windows Recovery plan first (usually on a USB stick), so that you can restore Windows if something goes wrong.
2. Decide how much space you want to give Ubuntu on the SSD and use the Windows Disk Management function to provide that space. The redeemed space must be formatted to EXT4, not NTFS or other.
3. Install the same version of Ubuntu on the SSD as you currently have on the HDD (hard drive). If not, the Timeshift Restore function will overwrite it with the older version. There is an alternative to this step. *
4. If you have used Timeshift before, you may have existing snapshots. If so, delete them, change the settings to those described at #275 on page 14, and then take a full, on demand, snapshot (will show with an O as a tag on completion).
5. Given you are using Windows 10, you will have an ESP (EFI System Partition) of 100 MB to 500 MB already in existence. If it is not more than half used, you can get Ubuntu to share that. If more than half is used, use Windows Disk Management to enlarge it a little.
6. Use Timeshift Restore function to restore your snapshot to the SSD. When it comes to the point that you choose the destination, choose the existing ESP on the SSD for the setup of your Ubuntu ESP and the Ubuntu EXT4 partition for the new Ubuntu.

At the end, reboot and you should have a Grub Menu which reflects the ability to choose and use Ubuntu and Windows. There may be two Ubuntus, until you get rid of the one on the HDD.

* If you are happy enough to use the same version of Ubuntu as you currently have, you can just prepare the SSD with an empty EXT4 partition of a suitable size and use the Timeshift restore to copy across your existing install lock, stock and barrel. In that case, you can skip Step 3 and proceed from there. Timeshift will adjust the /etc/fstab file to reflect the UUID on your new setup as part of the restore process.

Cheers

Wizard
 

Staff online

Members online


Top