Don´t want BTRFS snapshots during an AUR update

I do updates with “pamac upgrade -a” (I enter every day). I noticed that when there are AUR updates, a snapshot is also made with timeshift.

How can I turn this off? I only want a snapshot to be taken for “normal updates”.

What are you using to take those snapshots. I suppose timeshift-autosnap?

You would have to modify that. That being said, I think that wouldn’t be super easy to do. Once pacman/alpm gets a hold of the package it is the same as any other package being installed locally.

You would need to see if it is a foreign package in the alpm hook/script prior to calling timeshift. I am not sure if that is possible in pre-transaction hook. You would have to do some research there.

Autosnaphot can be temporarily skipped by setting SKIP_AUTOSNAP environment variable (e.g. sudo SKIP_AUTOSNAP= pacman -Syu)

i.e.

sudo pacman -Syu && sudo SKIP_AUTOSNAP= yay -Sua

…make it shorter with alias.

1 Like

I would guess on a BTRFS installation that the btrfs-autosnap package would be used.

I guess the difference is that timeshift-autosnap-manjaro – which is in community, while timeshift-autosnap is in AUR – tells TimeShift to make the snapshot, although by default it only does so for Btrfs filesystem.
Furthermore, btrfs-autosnap is also in AUR.

On the other hand, if you just want to prevent the build of the packages from ending up in the snapshots because of the sheer size, there are other ways.

Either move the build directory to the ramdisk (tmpfs). But that requires enough RAM

Or put the build directory in a subvolume that is not snapshotted

Indeed. We still don’t know how @professionallinuxexp snapshots are made.

Also I don’t think his issue has to do with what you suggest andreas, because his installed packages will still end up in a snapshot on a normal update, and the build directory is probably either a local directory, or a temp directory, not a system snapshoted directory (but here again we don’t have the info, on what is the issue behind the request, how he builds his AUR packages, and so on).

It is almost on default settings, I have not set anything special. I installed Manjaro KDE in January with a BTRFS filesystem. By default timeshift takes a snapshot every day. I turned that off in the GUI. Now every update (pamac upgrade -a) takes a snapshot. I have not set this up separately.

I just don’t want a snapshot to be taken on an AUR update. I want to continue using pamac.

pamac upgrade && SKIP_AUTOSNAP=pamac upgrade -a

Maybe should it work like this?

I think it should be SKIP_AUTOSNAP=1 pamac upgrade -a

Is there a rational reason you don’t want to make snapshots when installing AUR packages? That doesn’t make sense to me.

I think, when using many AUR packages e.g. 30+ packages, that would be a lot of work to create a new snapshot for each AUR package in a day.

Creating a snapshot manually would make sense.

Indeed if it takes a snapshot for each AUR package and you have many, then yes in this case I would understand. But I definitely would want a snapshot taken after all AUR packages are installed/updated.

On the other hand, with BTRFS snapshots are instantaneous so what’s the deal here?

Taking snapshots in Btrfs is almost “free”. The current status of the file system is noted without any additional effort. Only the release of free memory is delayed until the snapshot is deleted.

The effort for snapshots arises when they are deleted. Snapshots that are deleted after a short time (e.g. within a day) lead to an almost negligible effort.

In this respect, it would also be possible to create the snapshot (automatically) and delete it in the course of a day

The effort that arises when deleting a snapshot is exactly the effort that btrfs was able to save when creating the snapshot. So it’s almost a zero-sum game.

pamac upgrade && SKIP_AUTOSNAP=1 pamac upgrade -a

Does not work. :frowning: I have a new snapshot. :sob:

He means SKIP_AUTOSNAP=1 pamac upgrade -a.
But it does not help what I tested.


sudo SKIP_AUTOSNAP=1 pamac upgrade -a works for me. You need to run sudo

Thanks I wait for the next update. :smiley:

Hmmmm… Is the build process as root?

Yes, that is what the readme said:

Autosnaphot can be temporarily skipped by setting SKIP_AUTOSNAP environment variable (e.g. sudo SKIP_AUTOSNAP= pacman -Syu)

Read the codeline, if you understand bash

I do not understand the answer. Where does it say in the link if it is built as root?

No, it has nothing to do with build package.