snap-pac/examples.html
2021-10-04 14:10:53 +00:00

196 lines
No EOL
7.7 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>Example &#8212; snap-pac documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Troubleshooting" href="troubleshooting.html" />
<link rel="prev" title="Configuration" href="configuration.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">snap-pac</a></h1>
<p class="blurb">pacman hooks that use snapper to create pre/post btrfs snapshots</p>
<p>
<iframe src="https://ghbtns.com/github-btn.html?user=wesbarnett&repo=snap-pac&type=star&count=true&size=large&v=2"
allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
</p>
<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
<li class="toctree-l1"><a class="reference internal" href="configuration.html#environment-variables">Environment Variables</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Example</a></li>
<li class="toctree-l1"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="configuration.html" title="previous chapter">Configuration</a></li>
<li>Next: <a href="troubleshooting.html" title="next chapter">Troubleshooting</a></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="example">
<h1>Example<a class="headerlink" href="#example" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
</div>
<p>Here is an example of how the snapshots are created and how to rollback and pacman
transaction. Here the nano package is installed:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pacman -S nano
</pre></div>
</div>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>resolving dependencies...
looking for conflicting packages...
Packages (1) nano-2.5.3-1
Total Installed Size: 2.14 MiB
:: Proceed with installation? [Y/n] Y
(1/1) checking keys in keyring [######################################] 100%
(1/1) checking package integrity [######################################] 100%
(1/1) loading package files [######################################] 100%
(1/1) checking for file conflicts [######################################] 100%
(1/1) checking available disk space [######################################] 100%
:: Running pre-transaction hooks...
(1/1) Performing snapper pre snapshots for the following configurations...
=&gt; root: 1033
:: Processing package changes...
(1/1) installing nano [######################################] 100%
:: Running post-transaction hooks...
(1/1) Performing snapper post snapshots for the following configurations...
=&gt; root: 1034
</pre></div>
</div>
<p>The snapper snapshot number is given for each snapper configuration that is used. This
is also logged in pacmans log.</p>
<p>Here are the snapshots created before and after the pacman transaction:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>snapper -c root list -t pre-post <span class="p">|</span> tail -n <span class="m">1</span>
</pre></div>
</div>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>1033 | 1034 | Fri 22 Apr 2016 01:54:13 PM CDT | Fri 22 Apr 2016 01:54:14 PM CDT | pacman -S nano |
</pre></div>
</div>
<p>Here is what changed during the transaction:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>snapper -c root status <span class="m">1033</span>..1034
</pre></div>
</div>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>+..... /etc/nanorc
c..... /etc/snapper/.snap-pac-pre
+..... /usr/bin/nano
+..... /usr/bin/rnano
+..... /usr/share/doc/nano
+..... /usr/share/doc/nano/faq.html
+..... /usr/share/doc/nano/fr
+..... /usr/share/doc/nano/fr/nano.1.html
+..... /usr/share/doc/nano/fr/nanorc.5.html
+..... /usr/share/doc/nano/fr/rnano.1.html
</pre></div>
</div>
<p>The above output is truncated, but it continues. See <em class="manpage"><a class="manpage reference external" href="https://man.archlinux.org/man/snapper.8">snapper(8)</a></em> to for what each
symbol means. You can also do <code class="docutils literal notranslate"><span class="pre">snapper</span> <span class="pre">diff</span></code> in the same way.</p>
<p>Then, to undo the pacman transaction:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>snapper -c root undochange <span class="m">1033</span>..1034
</pre></div>
</div>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>create:0 modify:3 delete:100
</pre></div>
</div>
<p>Now nano is no longer installed, along with all the files it changed:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>pacman -Qi nano
</pre></div>
</div>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>error: package &#39;nano&#39; was not found
</pre></div>
</div>
</section>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
&copy;2021, Wes Barnett, PhD.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.2.0</a>
&amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="_sources/examples.rst.txt"
rel="nofollow">Page source</a>
</div>
<a href="https://github.com/wesbarnett/snap-pac" class="github">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" class="github"/>
</a>
</body>
</html>