0

So I have 3 different linux distros using the same partition to store backups using timeshift.

  1. Arch linux
  2. Arch linux
  3. Ubuntu 20.04

I installed one of the arch linux a few days ago, and now after doing all the base setup to get me started, I finally setup the timeshift in the end. But the problem is that both the arch linux installations have the same name when opening the timeshift app. See the image.enter image description here

See, both the arch installations have the same entry under System.
So, I just want a way to differentiate between the two installations of arch linux. So, what options have I got.

All are rsync backups, if that makes any difference.

Evan Carroll
  • 28,578
  • 45
  • 164
  • 290
Abhay Patil
  • 229
  • 2
  • 17

1 Answers1

1

Option 1, the "quick hack": The variable sys-distro in the files info.json in the snapshotdirs contains the system name, so you can do some scripting to change this every time a snapshot is created. (On most systems the snapshots dirs are the ones of the type /run/timeshift/backup/timeshift-btrfs/snapshots/DIFFERENTTIMES/)

Option 2 (untested), the cleanest and easiest solution: Change /etc/lsb_release and/or /etc/os_release. See also option 3 for the background on this.

Option 3 (untested), fix it for the whole world with code: I did some quick digging into the timeshift source code. (With "quick" I mean, some educated guesses were involved...) and this is what i found:

  • sys-distro is generated in write_control_file() and is based on the passed argument distro_full_name
  • current_distro.full_name() is usually passed for distro_full_name
  • full_name() is generated based on vars named dist_id, release and codename
  • These vars are all generated by get_dist_info()
  • get_dist_info() gets all this info from /etc/lsb-release and/or /etc/os-release (which is why is suggested option 2)
  • write_control_file() is defined src/Core/Main.vala. It's probably best to only change that last step.

Note: All options are for future backups, to do it for already created backups use option 1 and change the info.json files that already exist

Garo
  • 2,023
  • 9
  • 15
  • The first one only changes the name for the first backup. The rest backups are not renamed automatically. And the second option doesn't work. And the 3rd one, I am too afraid to touch the code. – Abhay Patil Nov 05 '21 at 00:47
  • I edited my answer to clarify it a bit:The first one didn't work in your case because you only changed the most recent `info.json` file, you need to change all of them. The 2nd option will indeed have no effect on already created snapshots. It will only start having effect when you create a new snapshot. For already existing snapshots you need option 1 but instead of using a script that changes the new `info.json` after creating a backup, change all `info.json` files in the already existing snapshot dirs (manually or with a script) – Garo Nov 06 '21 at 13:25
  • thanks that worked – Abhay Patil Nov 06 '21 at 17:13