Timeshift & Similar Solutions - Safeguard & Recover Your Linux

@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
 


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.
 
cron and borg are beyond my paygrade, but if it works for you, that's fine :)
 
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 ¯\_(ツ)_/¯
 
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.
 
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
 
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
 
@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
 
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
 
@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
 
That's great news, and you are welcome, Eddy.

Enjoy your Linux ;)

Wiz
 
Thanks Paul, but nicely done Tony George, author of Timeshift. :)
 
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!:)
 
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.
 
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
 
Cool, mate.

You may know this, but also for the benefit of others -

1. It is a System Restore solution rather than a backup solution
2. If you have /home covered in the settings (I do, but I store my documents, pictures, videos and so on elsewhere) be aware that if you have to restore from a Timeshift snapshot, it will not prompt you about replacing files/folders, it will just do so, returning you to the previous state. Don't lose important data.

Cheers and Happy Arch'ing

Wiz
You make an interesting point there. Last night I had to restore a laptop and was surprised to find my current data (from last night) was still there, even though the restore was two weeks old! Does it default to saving data by default and just restoring the underlying system? i was planning to post this question this morning.......
 
Note - the above post was copied from

https://www.linux.org/threads/dependency-issue-arch.47202

@SeanK - sounds like you have a bog standard (default) setup of Timeshift in play.

With that, you will have a tab that looks a bit like this

qSHSbFy.png


... whereas mine looks like this

KJk1JNb.png


So with yours (if I am correct), that snapshots taken and the snapshots restored will simply be for the system files in / and your /home folder (or partition) will be untouched. Hence

...and was surprised to find my current data (from last night) was still there, even though the restore was two weeks old!

That's fine if you want it that way.

In my case, my important Documents, Downloads, Pictures, Videos and Music I store elsewhere off-drive.

But I want to maintain my settings for Firefox, (maybe) Thunderbird, GIMP, the Nemo FM settings, My Desktop and panel settings, and a bunch of other apps that are stored in eg /home/chris/.config ... so I include /home with my snapshots.

My /home never gets bigger than, say, 2 to 3 GB so I can accommodate that in a snapshot with ease.

As an example for you and The Viewers, I am currently writing this while in a session with LInux Mint.

How much volume will a Timeshift snapshot on it consume?

I'll spare you the copious output and just give the bottom line.

Using

Code:
du -ah /

14 G   /

and for my home

Code:
2.4 G   /home/chris

... so a snapshot with /home included will consume 14 GB, and without /home 11.6 GB.

Hope this helps.

Wizard
 
The most important thing on your computer is your personal data, keep it backed up regularly, to external media, the O/S can easily be re installed.... :)
 
Note - the above post was copied from

https://www.linux.org/threads/dependency-issue-arch.47202

@SeanK - sounds like you have a bog standard (default) setup of Timeshift in play.

With that, you will have a tab that looks a bit like this

qSHSbFy.png


... whereas mine looks like this

KJk1JNb.png


So with yours (if I am correct), that snapshots taken and the snapshots restored will simply be for the system files in / and your /home folder (or partition) will be untouched. Hence



That's fine if you want it that way.

In my case, my important Documents, Downloads, Pictures, Videos and Music I store elsewhere off-drive.

But I want to maintain my settings for Firefox, (maybe) Thunderbird, GIMP, the Nemo FM settings, My Desktop and panel settings, and a bunch of other apps that are stored in eg /home/chris/.config ... so I include /home with my snapshots.

My /home never gets bigger than, say, 2 to 3 GB so I can accommodate that in a snapshot with ease.

As an example for you and The Viewers, I am currently writing this while in a session with LInux Mint.

How much volume will a Timeshift snapshot on it consume?

I'll spare you the copious output and just give the bottom line.

Using

Code:
du -ah /

14 G   /

and for my home

Code:
2.4 G   /home/chris

... so a snapshot with /home included will consume 14 GB, and without /home 11.6 GB.

Hope this helps.

Wizard
Thanks Wiz. It does help.
 

Members online


Top