Skip to content

APT hooks that use snapper to create pre/post btrfs snapshots like openSUSE's YaST

License

Notifications You must be signed in to change notification settings

pavinjosdev/snap-apt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snap-apt

Based on snap-pac by Wes Barnett and apt-btrfs-snapper by xhess.

Synopsis

This is a set of APT hook and script that automatically causes snapper to perform a pre and post snapshot before and after APT transactions, similar to how YaST does with OpenSuse. This provides a simple way to undo changes to a system after an APT transaction.

Installation

git clone https://github.com/pavinjosdev/snap-apt.git
chmod 755 snap-apt/scripts/snap_apt.py
cp snap-apt/scripts/snap_apt.py /usr/bin/snap-apt
cp snap-apt/hooks/80snap-apt /etc/apt/apt.conf.d/
cp snap-apt/logrotate/snap-apt /etc/logrotate.d/
rm -f /etc/apt/apt.conf.d/80snapper
sed -i 's/DISABLE_APT_SNAPSHOT="no"/DISABLE_APT_SNAPSHOT="yes"/g' /etc/default/snapper

Uninstallation

rm -f /usr/bin/snap-apt
rm -f /etc/apt/apt.conf.d/80snap-apt
rm -f /etc/logrotate.d/snap-apt
sed -i 's/DISABLE_APT_SNAPSHOT="yes"/DISABLE_APT_SNAPSHOT="no"/g' /etc/default/snapper

Configuration

Most likely, configuration is not needed. By default, the snapper configuration named root will have pre/post snapshots taken for every APT transaction.

Troubleshooting

By default, the log is written to /var/log/snap-apt.log. To enable debug output, set constant DEBUG = True in /usr/bin/snap-apt.

About

APT hooks that use snapper to create pre/post btrfs snapshots like openSUSE's YaST

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages