Skip to main content

System Assumptions

Before we dive in, let's clarify a few things. This article assumes you've already got Timeshift, yay, and timeshift-autosnap-manjaro installed and configured on your Manjaro system. We're also assuming you're using a Btrfs filesystem.

Introduction

If you're using Manjaro Linux and have set up Timeshift for backups, you might be curious about when it decides to take snapshots. Does it do it when you install a new package or only during system updates? Let's find out.

The Experiment

To get to the bottom of this, a simple test was conducted using the package cowsay. The package was installed and uninstalled a few times using both pacman and yay.

Here's how to install cowsay using yay:

yay -S cowsay

And to uninstall it:

yay -R cowsay

The Findings

You might assume that if Timeshift takes snapshots during updates, it would do the same during installs. But that's not the case. Timeshift only takes a snapshot when you update your system.

Here's what the Timeshift output looks like when you run a system update with yay -Syu:

yay -Syu
...
:: Running pre-transaction hooks...
(1/1) Creating Timeshift snapshot before upgrade...
...
BTRFS Snapshot saved successfully (1s)
...

This shows that Timeshift is creating a snapshot before upgrading your packages, which is a nice safety net.

The Why: Pros and Cons of Autosnapping on Install

Pros

  1. Safety Net: A snapshot could be a lifesaver if a new package causes issues.
  2. Easier Rollbacks: If things don't go as planned, you can easily revert to a stable state.
  3. Peace of Mind: It's reassuring to know that a snapshot is there if you need it.

Cons

  1. Disk Space: Snapshots aren't free; they take up disk space.
  2. Performance: Creating a snapshot takes a bit of time, which could slow down your install.
  3. Complexity: Adding this feature could complicate things a bit.

A Suggestion: Make it Opt-In

How about an option to enable autosnapping during package installs? This would let users decide whether they want this feature, and it's definitely something the Manjaro community should talk about.

Community Discussions and Solutions

There's been some chatter about making timeshift-autosnap-manjaro a default feature, but not much about extending this to package installs. One Manjaro forum discussion suggests making the installation of timeshift-autosnap-manjaro the default but optional. The post mentions, "Timeshift doesn't automatically start making backups on its own." (Source)

Additionally, the Arch User Repository (AUR) page for timeshift-autosnap mentions that Manjaro forked this and added a skipRsyncAutosnap parameter. (Source)

If you're feeling adventurous, you could even create a custom hook for this. There's a guide on the Manjaro forum that talks about installing and configuring Timeshift but doesn't mention autosnapping on package installs. (Source)

Conclusion

Timeshift's autosnap is a great safety feature for system updates but doesn't extend to package installs. If you want that extra layer of security when installing new packages, you'll have to do it manually for now. But who knows, maybe this will change in the future. It's good to be aware of what Timeshift does and doesn't do.