debian-reference/rawxml/10_data_management.rawxml
Osamu Aoki e097114eb9 Update mentioned packages in rawxml and po
Signed-off-by: Osamu Aoki <osamu@debian.org>
2026-01-02 23:27:42 +09:00

1927 lines
117 KiB
XML

<!-- vim: set sw=2 et sts=2 ft=xml: -->
<!-- Last content review: 2024-01-21T08:10:39 UTC -->
<chapter id="_data_management">
<title>Data management</title>
<para>Tools and tips for managing binary and text data on the Debian system are described.</para>
<section id="_sharing_copying_and_archiving">
<title>Sharing, copying, and archiving</title>
<warning>
<para>The uncoordinated write access to actively accessed devices and files from multiple processes must not be done to avoid the <ulink url="https://en.wikipedia.org/wiki/Race_condition">race condition</ulink>. <ulink url="https://en.wikipedia.org/wiki/File_locking">File locking</ulink> mechanisms using <literal>flock</literal>(1) may be used to avoid it.</para>
</warning>
<para>The security of the data and its controlled sharing have several aspects.</para>
<itemizedlist>
<listitem> <para> The creation of data archive </para> </listitem>
<listitem> <para> The remote storage access </para> </listitem>
<listitem> <para> The duplication </para> </listitem>
<listitem> <para> The tracking of the modification history </para> </listitem>
<listitem> <para> The facilitation of data sharing </para> </listitem>
<listitem> <para> The prevention of unauthorized file access </para> </listitem>
<listitem> <para> The detection of unauthorized file modification </para> </listitem>
</itemizedlist>
<para>These can be realized by using some combination of tools.</para>
<itemizedlist>
<listitem> <para> Archive and compression tools </para> </listitem>
<listitem> <para> Copy and synchronization tools </para> </listitem>
<listitem> <para> Network filesystems </para> </listitem>
<listitem> <para> Removable storage media </para> </listitem>
<listitem> <para> The secure shell </para> </listitem>
<listitem> <para> The authentication system </para> </listitem>
<listitem> <para> Version control system tools </para> </listitem>
<listitem> <para> Hash and cryptographic encryption tools </para> </listitem>
</itemizedlist>
<section id="_archive_and_compression_tools">
<title>Archive and compression tools</title>
<para>Here is a summary of archive and compression tools available on the Debian system.</para>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of archive and compression tools</title>
<tgroup cols="6">
<colspec colwidth="70pt" align="left"/>
<colspec colwidth="76pt" align="left"/>
<colspec colwidth="70pt" align="left"/>
<colspec colwidth="54pt" align="left"/>
<colspec colwidth="152pt" align="left"/>
<colspec colwidth="325pt" align="left"/>
<thead>
<row>
<entry> package </entry>
<entry> popcon </entry>
<entry> size </entry>
<entry> extension </entry>
<entry> command </entry>
<entry> comment </entry>
</row>
</thead>
<tbody>
<row>
<entry> <literal>tar</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>.tar</literal> </entry>
<entry><literal>tar</literal>(1) </entry>
<entry> the standard archiver (de facto standard) </entry>
</row>
<row>
<entry> <literal>cpio</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>.cpio</literal> </entry>
<entry><literal>cpio</literal>(1) </entry>
<entry> Unix System V style archiver, use with <literal>find</literal>(1) </entry>
</row>
<row>
<entry> <literal>binutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>.ar</literal> </entry>
<entry><literal>ar</literal>(1) </entry>
<entry> archiver for the creation of static libraries </entry>
</row>
<row>
<entry> <literal>fastjar</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>.jar</literal> </entry>
<entry><literal>fastjar</literal>(1) </entry>
<entry> archiver for Java (zip like) </entry>
</row>
<row>
<entry> <literal>pax</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>.pax</literal> </entry>
<entry><literal>pax</literal>(1) </entry>
<entry> new POSIX standard archiver, compromise between <literal>tar</literal> and <literal>cpio</literal> </entry>
</row>
<row>
<entry> <literal>gzip</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>.gz</literal> </entry>
<entry><literal>gzip</literal>(1), <literal>zcat</literal>(1), … </entry>
<entry> GNU <ulink url="https://en.wikipedia.org/wiki/LZ77_and_LZ78">LZ77</ulink> compression utility (de facto standard) </entry>
</row>
<row>
<entry> <literal>bzip2</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>.bz2</literal> </entry>
<entry><literal>bzip2</literal>(1), <literal>bzcat</literal>(1), … </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/Burrows-Wheeler_transform">Burrows-Wheeler block-sorting compression</ulink> utility with higher compression ratio than <literal>gzip</literal>(1) (slower than <literal>gzip</literal> with similar syntax) </entry>
</row>
<row>
<entry> <literal>lzma</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>.lzma</literal> </entry>
<entry><literal>lzma</literal>(1) </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/Lempel-Ziv-Markov_chain_algorithm">LZMA</ulink> compression utility with higher compression ratio than <literal>gzip</literal>(1) (deprecated) </entry>
</row>
<row>
<entry> <literal>xz-utils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>.xz</literal> </entry>
<entry><literal>xz</literal>(1), <literal>xzdec</literal>(1), … </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/Xz">XZ</ulink> compression utility with higher compression ratio than <literal>bzip2</literal>(1) (slower than <literal>gzip</literal> but faster than <literal>bzip2</literal>; replacement for <ulink url="https://en.wikipedia.org/wiki/Lempel-Ziv-Markov_chain_algorithm">LZMA</ulink> compression utility) </entry>
</row>
<row>
<entry> <literal>zstd</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>.zstd</literal> </entry>
<entry><literal>zstd</literal>(1), <literal>zstdcat</literal>(1), … </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/Zstandard">Zstandard</ulink> fast lossless compression utility </entry>
</row>
<row>
<entry> <literal>p7zip</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>.7z</literal> </entry>
<entry><literal>7zr</literal>(1), <literal>p7zip</literal>(1) </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/7-Zip">7-Zip</ulink> file archiver with high compression ratio (<ulink url="https://en.wikipedia.org/wiki/Lempel-Ziv-Markov_chain_algorithm">LZMA</ulink> compression) </entry>
</row>
<row>
<entry> <literal>p7zip-full</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>.7z</literal> </entry>
<entry><literal>7z</literal>(1), <literal>7za</literal>(1) </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/7-Zip">7-Zip</ulink> file archiver with high compression ratio (<ulink url="https://en.wikipedia.org/wiki/Lempel-Ziv-Markov_chain_algorithm">LZMA</ulink> compression and others) </entry>
</row>
<row>
<entry> <literal>lzop</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>.lzo</literal> </entry>
<entry><literal>lzop</literal>(1) </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/Lempel-Ziv-Oberhumer">LZO</ulink> compression utility with higher compression and decompression speed than <literal>gzip</literal>(1) (lower compression ratio than <literal>gzip</literal> with similar syntax) </entry>
</row>
<row>
<entry> <literal>zip</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>.zip</literal> </entry>
<entry><literal>zip</literal>(1) </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/Info-ZIP">InfoZIP</ulink>: DOS archive and compression tool </entry>
</row>
<row>
<entry> <literal>unzip</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>.zip</literal> </entry>
<entry><literal>unzip</literal>(1) </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/Info-ZIP">InfoZIP</ulink>: DOS unarchive and decompression tool </entry>
</row>
</tbody>
</tgroup>
</table>
<warning> <para>Do not set the "<literal>$TAPE</literal>" variable unless you know what to expect. It changes <literal>tar</literal>(1) behavior.</para> </warning>
<itemizedlist>
<listitem> <para>The gzipped <literal>tar</literal>(1) archive uses the file extension "<literal>.tgz</literal>" or "<literal>.tar.gz</literal>".</para> </listitem>
<listitem> <para>The xz-compressed <literal>tar</literal>(1) archive uses the file extension "<literal>.txz</literal>" or "<literal>.tar.xz</literal>".</para> </listitem>
<listitem> <para>Popular compression method in <ulink url="https://en.wikipedia.org/wiki/Free_and_open_source_software">FOSS</ulink> tools such as <literal>tar</literal>(1) has been moving as follows: <literal>gzip</literal><literal>bzip2</literal><literal>xz</literal></para> </listitem>
<listitem> <para><literal>cp</literal>(1), <literal>scp</literal>(1) and <literal>tar</literal>(1) may have some limitation for special files. <literal>cpio</literal>(1) is most versatile.</para> </listitem>
<listitem> <para><literal>cpio</literal>(1) is designed to be used with <literal>find</literal>(1) and other commands and suitable for creating backup scripts since the file selection part of the script can be tested independently.</para> </listitem>
<listitem> <para>Internal structure of Libreoffice data files are "<literal>.jar</literal>" file which can be opened also by <literal>unzip</literal>.</para> </listitem>
<listitem> <para>The de-facto cross platform archive tool is <literal>zip</literal>. Use it as "<literal>zip -rX</literal>" to attain the maximum compatibility. Use also the "<literal>-s</literal>" option, if the maximum file size matters.</para> </listitem>
</itemizedlist>
</section>
<section id="_copy_and_synchronization_tools">
<title>Copy and synchronization tools</title>
<para>Here is a summary of simple copy and backup tools available on the Debian system.</para>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of copy and synchronization tools</title>
<tgroup cols="5">
<colspec colwidth="92pt" align="left"/>
<colspec colwidth="76pt" align="left"/>
<colspec colwidth="70pt" align="left"/>
<colspec colwidth="38pt" align="left"/>
<colspec colwidth="369pt" align="left"/>
<thead>
<row>
<entry> package </entry>
<entry> popcon </entry>
<entry> size </entry>
<entry> tool </entry>
<entry> function </entry>
</row>
</thead>
<tbody>
<row>
<entry> <literal>coreutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> GNU cp </entry>
<entry> locally copy files and directories ("-a" for recursive) </entry>
</row>
<row>
<entry> <literal>openssh-client</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> scp </entry>
<entry> remotely copy files and directories (client, "<literal>-r</literal>" for recursive) </entry>
</row>
<row>
<entry> <literal>openssh-server</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> sshd </entry>
<entry> remotely copy files and directories (remote server) </entry>
</row>
<row>
<entry> <literal>rsync</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> </entry>
<entry> 1-way remote synchronization and backup </entry>
</row>
<row>
<entry> <literal>unison</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> </entry>
<entry> 2-way remote synchronization and backup </entry>
</row>
</tbody>
</tgroup>
</table>
<para>Copying files with <literal>rsync</literal>(8) offers richer features than others.</para>
<itemizedlist>
<listitem> <para> delta-transfer algorithm that sends only the differences between the source files and the existing files in the destination </para> </listitem>
<listitem> <para> quick check algorithm (by default) that looks for files that have changed in size or in last-modified time </para> </listitem>
<listitem> <para> "<literal>--exclude</literal>" and "<literal>--exclude-from</literal>" options similar to <literal>tar</literal>(1) </para> </listitem>
<listitem> <para> "a trailing slash on the source directory" syntax that avoids creating an additional directory level at the destination. </para> </listitem>
</itemizedlist>
<tip> <para>Version control system (VCS) tools in <xref linkend="list-of-vcs"/> can function as the multi-way copy and synchronization tools.</para> </tip>
</section>
<section id="_idioms_for_the_archive">
<title>Idioms for the archive</title>
<para>Here are several ways to archive and unarchive the entire content of the directory "<literal>./source</literal>" using different tools.</para>
<para>GNU <literal>tar</literal>(1):</para>
<screen>$ tar -cvJf archive.tar.xz ./source
$ tar -xvJf archive.tar.xz</screen>
<para>Alternatively, by the following.</para>
<screen>$ find ./source -xdev -print0 | tar -cvJf archive.tar.xz --null -T -</screen>
<para><literal>cpio</literal>(1):</para>
<screen>$ find ./source -xdev -print0 | cpio -ov --null &gt; archive.cpio; xz archive.cpio
$ zcat archive.cpio.xz | cpio -i</screen>
</section>
<section id="_idioms_for_the_copy">
<title>Idioms for the copy</title>
<para>Here are several ways to copy the entire content of the directory "<literal>./source</literal>" using different tools.</para>
<itemizedlist>
<listitem>
<para> Local copy: "<literal>./source</literal>" directory → "<literal>/dest</literal>" directory </para>
</listitem>
<listitem>
<para> Remote copy: "<literal>./source</literal>" directory at local host → "<literal>/dest</literal>" directory at "<literal>user@host.dom</literal>" host </para>
</listitem>
</itemizedlist>
<para><literal>rsync</literal>(8):</para>
<screen># cd ./source; rsync -aHAXSv . /dest
# cd ./source; rsync -aHAXSv . user@host.dom:/dest</screen>
<para>You can alternatively use "a trailing slash on the source directory" syntax.</para>
<screen># rsync -aHAXSv ./source/ /dest
# rsync -aHAXSv ./source/ user@host.dom:/dest</screen>
<para>Alternatively, by the following.</para>
<screen># cd ./source; find . -print0 | rsync -aHAXSv0 --files-from=- . /dest
# cd ./source; find . -print0 | rsync -aHAXSv0 --files-from=- . user@host.dom:/dest</screen>
<para>GNU <literal>cp</literal>(1) and openSSH <literal>scp</literal>(1):</para>
<screen># cd ./source; cp -a . /dest
# cd ./source; scp -pr . user@host.dom:/dest</screen>
<para>GNU <literal>tar</literal>(1):</para>
<screen># (cd ./source &amp;&amp; tar cf - . ) | (cd /dest &amp;&amp; tar xvfp - )
# (cd ./source &amp;&amp; tar cf - . ) | ssh user@host.dom '(cd /dest &amp;&amp; tar xvfp - )'</screen>
<para><literal>cpio</literal>(1):</para>
<screen># cd ./source; find . -print0 | cpio -pvdm --null --sparse /dest</screen>
<para>You can substitute "<literal>.</literal>" with "<literal>foo</literal>" for all examples containing "<literal>.</literal>" to copy files from "<literal>./source/foo</literal>" directory to "<literal>/dest/foo</literal>" directory.</para>
<para>You can substitute "<literal>.</literal>" with the absolute path "<literal>/path/to/source/foo</literal>" for all examples containing "<literal>.</literal>" to drop "<literal>cd ./source;</literal>". These copy files to different locations depending on tools used as follows.</para>
<itemizedlist>
<listitem> <para> "<literal>/dest/foo</literal>": <literal>rsync</literal>(8), GNU <literal>cp</literal>(1), and <literal>scp</literal>(1) </para> </listitem>
<listitem> <para> "<literal>/dest/path/to/source/foo</literal>": GNU <literal>tar</literal>(1), and <literal>cpio</literal>(1) </para> </listitem>
</itemizedlist>
<tip> <para><literal>rsync</literal>(8) and GNU <literal>cp</literal>(1) have option "<literal>-u</literal>" to skip files that are newer on the receiver.</para> </tip>
</section>
<section id="_idioms_for_the_selection_of_files">
<title>Idioms for the selection of files</title>
<para><literal>find</literal>(1) is used to select files for archive and copy commands (see <xref linkend="_idioms_for_the_archive"/> and <xref linkend="_idioms_for_the_copy"/>) or for <literal>xargs</literal>(1) (see <xref linkend="_repeating_a_command_looping_over_files"/>). This can be enhanced by using its command arguments.</para>
<para>Basic syntax of <literal>find</literal>(1) can be summarized as the following.</para>
<itemizedlist>
<listitem> <para> Its conditional arguments are evaluated from left to right. </para> </listitem>
<listitem> <para> This evaluation stops once its outcome is determined. </para> </listitem>
<listitem> <para> "Logical <emphasis role="strong">OR</emphasis>" (specified by "<literal>-o</literal>" between conditionals) has lower precedence than "logical <emphasis role="strong">AND</emphasis>" (specified by "<literal>-a</literal>" or nothing between conditionals). </para> </listitem>
<listitem> <para> "Logical <emphasis role="strong">NOT</emphasis>" (specified by "<literal>!</literal>" before a conditional) has higher precedence than "logical <emphasis role="strong">AND</emphasis>". </para> </listitem>
<listitem> <para> "<literal>-prune</literal>" always returns logical <emphasis role="strong">TRUE</emphasis> and, if it is a directory, searching of file is stopped beyond this point. </para> </listitem>
<listitem> <para> "<literal>-name</literal>" matches the base of the filename with shell glob (see <xref linkend="_shell_glob"/>) but it also matches its initial "<literal>.</literal>" with metacharacters such as "<literal>*</literal>" and "<literal>?</literal>". (New <ulink url="https://en.wikipedia.org/wiki/POSIX">POSIX</ulink> feature) </para> </listitem>
<listitem> <para> "<literal>-regex</literal>" matches the full path with emacs style <emphasis role="strong">BRE</emphasis> (see <xref linkend="_regular_expressions"/>) as default. </para> </listitem>
<listitem> <para> "<literal>-size</literal>" matches the file based on the file size (value precedented with "<literal>+</literal>" for larger, precedented with "<literal>-</literal>" for smaller) </para> </listitem>
<listitem> <para> "<literal>-newer</literal>" matches the file newer than the one specified in its argument. </para> </listitem>
<listitem> <para> "<literal>-print0</literal>" always returns logical <emphasis role="strong">TRUE</emphasis> and print the full filename (<ulink url="https://en.wikipedia.org/wiki/Null_character">null terminated</ulink>) on the standard output. </para> </listitem>
</itemizedlist>
<para><literal>find</literal>(1) is often used with an idiomatic style as the following.</para>
<screen># find /path/to \
-xdev -regextype posix-extended \
-type f -regex ".*\.cpio|.*~" -prune -o \
-type d -regex ".*/\.git" -prune -o \
-type f -size +99M -prune -o \
-type f -newer /path/to/timestamp -print0</screen>
<para>This means to do following actions.</para>
<orderedlist>
<listitem> <para> Search all files starting from "<literal>/path/to</literal>" </para> </listitem>
<listitem> <para> Globally limit its search within its starting filesystem and uses <emphasis role="strong">ERE</emphasis> (see <xref linkend="_regular_expressions"/>) instead </para> </listitem>
<listitem> <para> Exclude files matching regex of "<literal>.*\.cpio</literal>" or "<literal>.*~</literal>" from search by stop processing </para> </listitem>
<listitem> <para> Exclude directories matching regex of "<literal>.*/\.git</literal>" from search by stop processing </para> </listitem>
<listitem> <para> Exclude files larger than 99 Megabytes (units of 1048576 bytes) from search by stop processing </para> </listitem>
<listitem> <para> Print filenames which satisfy above search conditions and are newer than "<literal>/path/to/timestamp</literal>" </para> </listitem>
</orderedlist>
<para>Please note the idiomatic use of "<literal>-prune -o</literal>" to exclude files in the above example.</para>
<note> <para>For non-Debian <ulink url="https://en.wikipedia.org/wiki/Unix-like">Unix-like</ulink> system, some options may not be supported by <literal>find</literal>(1). In such a case, please consider to adjust matching methods and replace "<literal>-print0</literal>" with "<literal>-print</literal>". You may need to adjust related commands too.</para> </note>
</section>
<section id="_archive_media">
<title>Archive media</title>
<para>When choosing <ulink url="https://en.wikipedia.org/wiki/Computer_data_storage">computer data storage media</ulink> for important data archive, you should be careful about their limitations. For small personal data backup, I use CD-R and DVD-R by the brand name company and store in a cool, shaded, dry, clean environment. (Tape archive media seem to be popular for professional use.)</para>
<note> <para><ulink url="https://en.wikipedia.org/wiki/Safe">A fire-resistant safe</ulink> are meant for paper documents. Most of the computer data storage media have less temperature tolerance than paper. I usually rely on multiple secure encrypted copies stored in multiple secure locations.</para> </note>
<para>Optimistic storage life of archive media seen on the net (mostly from vendor info).</para>
<itemizedlist>
<listitem> <para> 100+ years : Acid free paper with ink </para> </listitem>
<listitem> <para> 100 years : Optical storage (CD/DVD, CD/DVD-R) </para> </listitem>
<listitem> <para> 30 years : Magnetic storage (tape, floppy) </para> </listitem>
<listitem> <para> 20 years : Phase change optical storage (CD-RW) </para> </listitem>
</itemizedlist>
<para>These do not count on the mechanical failures due to handling etc.</para>
<para>Optimistic write cycle of archive media seen on the net (mostly from vendor info).</para>
<itemizedlist>
<listitem> <para> 250,000+ cycles : Harddisk drive </para> </listitem>
<listitem> <para> 10,000+ cycles : Flash memory </para> </listitem>
<listitem> <para> 1,000 cycles : CD/DVD-RW </para> </listitem>
<listitem> <para> 1 cycles : CD/DVD-R, paper </para> </listitem>
</itemizedlist>
<caution> <para>Figures of storage life and write cycle here should not be used for decisions on any critical data storage. Please consult the specific product information provided by the manufacture.</para> </caution>
<tip> <para>Since CD/DVD-R and paper have only 1 write cycle, they inherently prevent accidental data loss by overwriting. This is advantage!</para> </tip>
<tip> <para>If you need fast and frequent backup of large amount of data, a hard disk on a remote host linked by a fast network connection, may be the only realistic option.</para> </tip>
<tip> <para>If you use re-writable media for your backups, use of filesystem such as <ulink url="https://en.wikipedia.org/wiki/Btrfs">btrfs</ulink> or <ulink url="https://en.wikipedia.org/wiki/ZFS">zfs</ulink> which supports read-only snapshots may be a good idea.</para> </tip>
</section>
<section id="_removable_storage_device">
<title>Removable storage device</title>
<para>Removable storage devices may be any one of the following.</para>
<itemizedlist>
<listitem> <para> <ulink url="https://en.wikipedia.org/wiki/USB_flash_drive">USB flash drive</ulink> </para> </listitem>
<listitem> <para> <ulink url="https://en.wikipedia.org/wiki/Hard_disk_drive">Hard disk drive</ulink> </para> </listitem>
<listitem> <para> <ulink url="https://en.wikipedia.org/wiki/Optical_disc_drive">Optical disc drive</ulink> </para> </listitem>
<listitem> <para> Digital camera </para> </listitem>
<listitem> <para> Digital music player </para> </listitem>
</itemizedlist>
<para>They may be connected via any one of the following.</para>
<itemizedlist>
<listitem> <para> <ulink url="https://en.wikipedia.org/wiki/Universal_Serial_Bus">USB</ulink> </para> </listitem>
<listitem> <para> <ulink url="https://en.wikipedia.org/wiki/IEEE_1394">IEEE 1394 / FireWire</ulink> </para> </listitem>
<listitem> <para> <ulink url="https://en.wikipedia.org/wiki/PC_card">PC Card</ulink> </para> </listitem>
</itemizedlist>
<para>Modern desktop environments such as GNOME and KDE can mount these removable devices automatically without a matching "<literal>/etc/fstab</literal>" entry.</para>
<itemizedlist>
<listitem> <para><literal>udisks2</literal> package provides a daemon and associated utilities to mount and unmount these devices. </para> </listitem> <listitem> <para><ulink url="https://en.wikipedia.org/wiki/D-Bus">D-bus</ulink> creates events to initiate automatic processes. </para> </listitem>
<listitem> <para><ulink url="https://en.wikipedia.org/wiki/PolicyKit">PolicyKit</ulink> provides required privileges. </para> </listitem>
</itemizedlist>
<tip> <para>Automounted devices may have the "<literal>uhelper=</literal>" mount option which is used by <literal>umount</literal>(8).</para> </tip>
<tip> <para>Automounting under modern desktop environment happens only when those removable media devices are not listed in "<literal>/etc/fstab</literal>".</para> </tip>
<para>Mount point under modern desktop environment is chosen as "<literal>/media/<emphasis>username/disk_label</emphasis></literal>" which can be customized by the following.</para>
<itemizedlist>
<listitem> <para><literal>mlabel</literal>(1) for FAT filesystem </para> </listitem>
<listitem> <para><literal>genisoimage</literal>(1) with "<literal>-V</literal>" option for ISO9660 filesystem </para> </listitem>
<listitem> <para><literal>tune2fs</literal>(1) with "<literal>-L</literal>" option for ext2/ext3/ext4 filesystem </para> </listitem>
</itemizedlist>
<tip> <para>The choice of encoding may need to be provided as mount option (see <xref linkend="_filename_encoding"/>).</para> </tip>
<tip> <para>The use of the GUI menu to unmount a filesystem may remove its dynamically generated device node such as "<literal>/dev/sdc</literal>". If you wish to keep its device node, unmount it with the <literal>umount</literal>(8) command from the shell prompt.</para> </tip>
</section>
<section id="_filesystem_choice_for_sharing_data">
<title>Filesystem choice for sharing data</title>
<para>When sharing data with other system via removable storage device, you should format it with common <ulink url="https://en.wikipedia.org/wiki/File_system">filesystem</ulink> supported by both systems. Here is a list of filesystem choices.</para>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of filesystem choices for removable storage devices with typical usage scenarios</title>
<tgroup cols="2">
<colspec colwidth="352pt" align="left"/>
<colspec colwidth="396pt" align="left"/>
<thead>
<row>
<entry> filesystem name </entry>
<entry> typical usage scenario </entry>
</row>
</thead>
<tbody>
<row>
<entry> <ulink url="https://en.wikipedia.org/wiki/File_Allocation_Table">FAT12</ulink> </entry>
<entry> cross platform sharing of data on the floppy disk (&lt;32MiB) </entry>
</row>
<row>
<entry> <ulink url="https://en.wikipedia.org/wiki/File_Allocation_Table">FAT16</ulink> </entry>
<entry> cross platform sharing of data on the small hard disk like device (&lt;2GiB) </entry>
</row>
<row>
<entry> <ulink url="https://en.wikipedia.org/wiki/File_Allocation_Table">FAT32</ulink> </entry>
<entry> cross platform sharing of data on the large hard disk like device (&lt;8TiB, supported by newer than MS Windows95 OSR2) </entry>
</row>
<row>
<entry> <ulink url="https://en.wikipedia.org/wiki/ExFAT">exFAT</ulink> </entry>
<entry> cross platform sharing of data on the large hard disk like device (&lt;512TiB, supported by WindowsXP, Mac OS X Snow Leopard 10.6.5, and Linux kernel since 5.4 release) </entry>
</row>
<row>
<entry> <ulink url="https://en.wikipedia.org/wiki/NTFS">NTFS</ulink> </entry>
<entry> cross platform sharing of data on the large hard disk like device (supported natively on <ulink url="https://en.wikipedia.org/wiki/Windows_NT">MS Windows NT</ulink> and later version, and supported by <ulink url="https://en.wikipedia.org/wiki/NTFS-3G">NTFS-3G</ulink> via <ulink url="https://en.wikipedia.org/wiki/Filesystem_in_Userspace">FUSE</ulink> on Linux) </entry>
</row>
<row>
<entry> <ulink url="https://en.wikipedia.org/wiki/ISO_9660">ISO9660</ulink> </entry>
<entry> cross platform sharing of static data on CD-R and DVD+/-R </entry>
</row>
<row>
<entry> <ulink url="https://en.wikipedia.org/wiki/Universal_Disk_Format">UDF</ulink> </entry>
<entry> incremental data writing on CD-R and DVD+/-R (new) </entry>
</row>
<row>
<entry> <ulink url="https://en.wikipedia.org/wiki/Minix_file_system">MINIX</ulink> </entry>
<entry> space efficient unix file data storage on the floppy disk </entry>
</row>
<row>
<entry> <ulink url="https://en.wikipedia.org/wiki/Ext2">ext2</ulink> </entry>
<entry> sharing of data on the hard disk like device with older Linux systems </entry>
</row>
<row>
<entry> <ulink url="https://en.wikipedia.org/wiki/Ext3">ext3</ulink> </entry>
<entry> sharing of data on the hard disk like device with older Linux systems </entry>
</row>
<row>
<entry> <ulink url="https://en.wikipedia.org/wiki/Ext4">ext4</ulink> </entry>
<entry> sharing of data on the hard disk like device with current Linux systems </entry>
</row>
<row>
<entry> <ulink url="https://en.wikipedia.org/wiki/Btrfs">btrfs</ulink> </entry>
<entry> sharing of data on the hard disk like device with current Linux systems with read-only snapshots</entry>
</row>
</tbody>
</tgroup>
</table>
<tip> <para>See <xref linkend="_removable_disk_encryption_with_dm_crypt_luks"/> for cross platform sharing of data using device level encryption.</para> </tip>
<para>The FAT filesystem is supported by almost all modern operating systems and is quite useful for the data exchange purpose via removable hard disk like media.</para>
<para>When formatting removable hard disk like devices for cross platform sharing of data with the FAT filesystem, the following should be safe choices.</para>
<itemizedlist>
<listitem>
<para>
Partitioning them with <literal>fdisk</literal>(8), <literal>cfdisk</literal>(8) or <literal>parted</literal>(8) (see <xref linkend="_disk_partition_configuration"/>) into a single primary partition and to mark it as the following.
</para>
<itemizedlist>
<listitem> <para> Type "6" for FAT16 for media smaller than 2GB. </para> </listitem>
<listitem> <para> Type "c" for FAT32 (LBA) for larger media. </para> </listitem>
</itemizedlist>
</listitem>
<listitem>
<para> Formatting the primary partition with <literal>mkfs.vfat</literal>(8) with the following. </para>
<itemizedlist>
<listitem> <para> Just its device name, e.g. "<literal>/dev/sda1</literal>" for FAT16 </para> </listitem>
<listitem> <para> The explicit option and its device name, e.g. "<literal>-F 32 /dev/sda1</literal>" for FAT32 </para> </listitem>
</itemizedlist>
</listitem>
</itemizedlist>
<para>When using the FAT or ISO9660 filesystems for sharing data, the following should be the safe considerations.</para>
<itemizedlist>
<listitem> <para> Archiving files into an archive file first using <literal>tar</literal>(1), or <literal>cpio</literal>(1) to retain the long filename, the symbolic link, the original Unix file permission and the owner information. </para> </listitem>
<listitem> <para> Splitting the archive file into less than 2 GiB chunks with the <literal>split</literal>(1) command to protect it from the file size limitation. </para> </listitem>
<listitem> <para> Encrypting the archive file to secure its contents from the unauthorized access. </para> </listitem>
</itemizedlist>
<note> <para>For FAT filesystems by its design, the maximum file size is <literal>(2^32 - 1) bytes = (4GiB - 1 byte)</literal>. For some applications on the older 32 bit OS, the maximum file size was even smaller <literal>(2^31 - 1) bytes = (2GiB - 1 byte)</literal>. Debian does not suffer the latter problem.</para> </note>
<note> <para>Microsoft itself does not recommend to use FAT for drives or partitions of over 200 MB. Microsoft highlights its short comings such as inefficient disk space usage in their "<ulink url="https://support.microsoft.com/kb/100108/">Overview of FAT, HPFS, and NTFS File Systems</ulink>". Of course, we should normally use the ext4 filesystem for Linux.</para> </note>
<tip> <para>For more on filesystems and accessing filesystems, please read "<ulink url="https://tldp.org/HOWTO/Filesystems-HOWTO.html">Filesystems HOWTO</ulink>".</para> </tip>
</section>
<section id="_sharing_data_via_network">
<title>Sharing data via network</title>
<para>When sharing data with other system via network, you should use common service. Here are some hints.</para>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of the network service to chose with the typical usage scenario</title>
<tgroup cols="2">
<colspec colwidth="798pt" align="left"/>
<colspec colwidth="716pt" align="left"/>
<thead>
<row>
<entry> network service </entry>
<entry> description of typical usage scenario </entry>
</row>
</thead>
<tbody>
<row>
<entry><ulink url="https://en.wikipedia.org/wiki/Server_Message_Block">SMB/CIFS</ulink> network mounted filesystem with <ulink url="https://en.wikipedia.org/wiki/Samba_(software)">Samba</ulink> </entry>
<entry> sharing files via "Microsoft Windows Network", see <literal>smb.conf</literal>(5) and <ulink url="https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/">The Official Samba 3.x.x HOWTO and Reference Guide</ulink> or the <literal>samba-doc</literal> package </entry>
</row>
<row>
<entry><ulink url="https://en.wikipedia.org/wiki/Network_File_System_(protocol)">NFS</ulink> network mounted filesystem with the Linux kernel </entry>
<entry> sharing files via "Unix/Linux Network", see <literal>exports</literal>(5) and <ulink url="https://tldp.org/HOWTO/NFS-HOWTO/index.html">Linux NFS-HOWTO</ulink> </entry>
</row>
<row>
<entry><ulink url="https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol">HTTP</ulink> service </entry>
<entry> sharing file between the web server/client </entry>
</row>
<row>
<entry><ulink url="https://en.wikipedia.org/wiki/Https">HTTPS</ulink> service </entry>
<entry> sharing file between the web server/client with encrypted Secure Sockets Layer (SSL) or <ulink url="https://en.wikipedia.org/wiki/Transport_Layer_Security">Transport Layer Security</ulink> (TLS) </entry>
</row>
<row>
<entry><ulink url="https://en.wikipedia.org/wiki/File_Transfer_Protocol">FTP</ulink> service </entry>
<entry> sharing file between the FTP server/client </entry>
</row>
</tbody>
</tgroup>
</table>
<para>Although these filesystems mounted over network and file transfer methods over network are quite convenient for sharing data, these may be insecure. Their network connection must be secured by the following.</para>
<itemizedlist>
<listitem> <para> Encrypt it with <ulink url="https://en.wikipedia.org/wiki/Transport_Layer_Security">SSL/TLS</ulink> </para> </listitem>
<listitem> <para> Tunnel it via <ulink url="https://en.wikipedia.org/wiki/Secure_Shell">SSH</ulink> </para> </listitem>
<listitem> <para> Tunnel it via <ulink url="https://en.wikipedia.org/wiki/Virtual_private_network">VPN</ulink> </para> </listitem>
<listitem> <para> Limit it behind the secure firewall </para> </listitem>
</itemizedlist>
<para>See also <xref linkend="_other_network_application_servers"/> and <xref linkend="_other_network_application_clients"/>.</para>
</section>
</section>
<section id="_backup_and_recovery">
<title>Backup and recovery</title>
<para>We all know that computers fail sometime or human errors cause system and data damages. Backup and recovery operations are the essential part of successful system administration. All possible failure modes hit you some day.</para>
<tip> <para>Keep your backup system simple and backup your system often. Having backup data is more important than how technically good your backup method is.</para> </tip>
<section id="_backup_and_recovery_policy">
<title>Backup and recovery policy</title>
<para>There are 3 key factors which determine actual backup and recovery policy.</para>
<orderedlist>
<listitem>
<para> Knowing what to backup and recover. </para>
<itemizedlist>
<listitem> <para> Data files directly created by you: data in "<literal>~/</literal>" </para> </listitem>
<listitem> <para> Data files created by applications used by you: data in "<literal>/var/</literal>" (except "<literal>/var/cache/</literal>", "<literal>/var/run/</literal>", and "<literal>/var/tmp/</literal>") </para> </listitem>
<listitem> <para> System configuration files: data in "<literal>/etc/</literal>" </para> </listitem>
<listitem> <para> Local programs: data in "<literal>/usr/local/</literal>" or "<literal>/opt/</literal>" </para> </listitem>
<listitem> <para> System installation information: a memo in plain text on key steps (partition, …) </para> </listitem>
<listitem>
<para> Proven set of data: confirmed by experimental recovery operations in advance </para>
<itemizedlist>
<listitem> <para> Cron job as a user process: files in "<literal>/var/spool/cron/crontabs</literal>" directory and restart <literal>cron</literal>(8). See <xref linkend="_scheduling_tasks_regularly"/> for <literal>cron</literal>(8) and <literal>crontab</literal>(1).</para> </listitem>
<listitem> <para> Systemd timer jobs as user processes: files in "<literal>~/.config/systemd/user</literal>" directory. See <literal>systemd.timer</literal>(5) and <literal>systemd.service</literal>(5).</para> </listitem>
<listitem> <para> Autostart jobs as user processes: files in "<literal>~/.config/autostart</literal>" directory. See <ulink url="https://specifications.freedesktop.org/autostart-spec/autostart-spec-latest.html">Desktop Application Autostart Specification</ulink>.</para> </listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para> Knowing how to backup and recover. </para>
<itemizedlist>
<listitem> <para> Secure storage of data: protection from overwrite and system failure </para> </listitem>
<listitem> <para> Frequent backup: scheduled backup </para> </listitem>
<listitem> <para> Redundant backup: data mirroring </para> </listitem>
<listitem> <para> Fool proof process: easy single command backup </para> </listitem>
</itemizedlist>
</listitem>
<listitem>
<para> Assessing risks and costs involved. </para>
<itemizedlist>
<listitem>
<para> Risk of data when lost </para>
<itemizedlist>
<listitem> <para>Data should be at least on different disk partitions preferably on different disks and machines to withstand the filesystem corruption. Important data are best stored on a read-only filesystem. <footnote> <para>A write-once media such as CD/DVD-R can prevent overwrite accidents. (See <xref linkend="_the_binary_data"/> for how to write to the storage media from the shell commandline. GNOME desktop GUI environment gives you easy access via menu: "Places→CD/DVD Creator".) </para> </footnote> </para> </listitem>
</itemizedlist>
</listitem>
<listitem>
<para> Risk of data when breached </para>
<itemizedlist>
<listitem> <para>Sensitive identity data such as "<literal>/etc/ssh/ssh_host_*_key</literal>", "<literal>~/.gnupg/*</literal>", "<literal>~/.ssh/*</literal>", "<literal>~/.local/share/keyrings/*</literal>", "<literal>/etc/passwd</literal>", "<literal>/etc/shadow</literal>", "<literal>popularity-contest.conf</literal>", "<literal>/etc/ppp/pap-secrets</literal>", and "<literal>/etc/exim4/passwd.client</literal>" should be backed up as encrypted. <footnote> <para> Some of these data can not be regenerated by entering the same input string to the system.</para> </footnote> (See <xref linkend="_data_encryption_tips"/>.)</para> </listitem>
<listitem> <para>Never hard code system login password nor decryption passphrase in any script even on any trusted system. (See <xref linkend="_password_keyring"/>.)</para> </listitem>
</itemizedlist>
</listitem>
<listitem>
<para> Failure mode and their possibility </para>
<itemizedlist>
<listitem> <para> Hardware (especially HDD) will break </para> </listitem>
<listitem> <para> Filesystem may be corrupted and data in it may be lost </para> </listitem>
<listitem> <para> Remote storage system can't be trusted for security breaches </para> </listitem>
<listitem> <para> Weak password protection can be easily compromised </para> </listitem>
<listitem> <para> File permission system may be compromised </para> </listitem>
</itemizedlist>
</listitem>
<listitem>
<para> Required resources for backup: human, hardware, software, … </para>
<itemizedlist>
<listitem> <para> Automatic scheduled backup with cron job or systemd timer job </para> </listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</listitem>
</orderedlist>
<tip> <para>You can recover debconf configuration data with "<literal>debconf-set-selections debconf-selections</literal>" and dpkg selection data with "<literal>dpkg --set-selection &lt;dpkg-selections.list</literal>".</para> </tip>
<note> <para>Do not back up the pseudo-filesystem contents found on <literal>/proc</literal>, <literal>/sys</literal>, <literal>/tmp</literal>, and <literal>/run</literal> (see <xref linkend="_procfs_and_sysfs"/> and <xref linkend="_tmpfs"/>). Unless you know exactly what you are doing, they are huge useless data.</para> </note>
<note> <para>You may wish to stop some application daemons such as MTA (see <xref linkend="_mail_transport_agent_mta"/>) while backing up data.</para> </note>
</section>
<section id="_backup_utility_suites">
<title>Backup utility suites</title>
<para>Here is a select list of notable backup utility suites available on the Debian system.</para>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of backup suite utilities</title>
<tgroup cols="4">
<colspec colwidth="92pt" align="left"/>
<colspec colwidth="76pt" align="left"/>
<colspec colwidth="70pt" align="left"/>
<colspec colwidth="510pt" align="left"/>
<thead>
<row>
<entry> package </entry>
<entry> popcon </entry>
<entry> size </entry>
<entry> description </entry>
</row>
</thead>
<tbody>
<row>
<entry> <literal>bacula-common</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/Bacula">Bacula</ulink>: network backup, recovery and verification - common support files </entry>
</row>
<row>
<entry> <literal>bacula-client</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/Bacula">Bacula</ulink>: network backup, recovery and verification - client meta-package </entry>
</row>
<row>
<entry> <literal>bacula-console</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/Bacula">Bacula</ulink>: network backup, recovery and verification - text console </entry>
</row>
<row>
<entry> <literal>bacula-server</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/Bacula">Bacula</ulink>: network backup, recovery and verification - server meta-package </entry>
</row>
<row>
<entry> <literal>amanda-common</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/Advanced_Maryland_Automatic_Network_Disk_Archiver">Amanda</ulink>: Advanced Maryland Automatic Network Disk Archiver (Libs) </entry>
</row>
<row>
<entry> <literal>amanda-client</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/Advanced_Maryland_Automatic_Network_Disk_Archiver">Amanda</ulink>: Advanced Maryland Automatic Network Disk Archiver (Client) </entry>
</row>
<row>
<entry> <literal>amanda-server</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/Advanced_Maryland_Automatic_Network_Disk_Archiver">Amanda</ulink>: Advanced Maryland Automatic Network Disk Archiver (Server) </entry>
</row>
<row>
<entry> <literal>backuppc</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><ulink url="https://en.wikipedia.org/wiki/Backuppc">BackupPC</ulink> is a high-performance, enterprise-grade system for backing up PCs (disk based) </entry>
</row>
<row>
<entry> <literal>duplicity</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> (remote) incremental backup </entry>
</row>
<row>
<entry> <literal>deja-dup</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> GUI frontend for duplicity </entry>
</row>
<row>
<entry> <literal>borgbackup</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> (remote) deduplicating backup </entry>
</row>
<!--
<row>
<entry> <literal>borgbackup2</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> (remote) deduplicating backup </entry>
</row>
-->
<row>
<entry> <literal>borgmatic</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> borgbackup helper </entry>
</row>
<row>
<entry> <literal>rdiff-backup</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> (remote) incremental backup </entry>
</row>
<row>
<entry> <literal>restic</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> (remote) incremental backup </entry>
</row>
<!-- Removed from bullseye
<row>
<entry> <literal>rsnapshot</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> (remote) incremental backup </entry>
</row>
-->
<row>
<entry> <literal>backupninja</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> lightweight, extensible <emphasis role="strong">meta-backup</emphasis> system </entry>
</row>
<!-- Removed
<row>
<entry> <literal>flexbackup</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> (remote) incremental backup </entry>
</row>
-->
<row>
<entry> <literal>slbackup</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> (remote) incremental backup </entry>
</row>
<row>
<entry> <literal>backup-manager</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> command-line backup tool </entry>
</row>
<row>
<entry> <literal>backup2l</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> low-maintenance backup/restore tool for mountable media (disk based) </entry>
</row>
</tbody>
</tgroup>
</table>
<para>Backup tools have their specialized focuses.</para>
<itemizedlist>
<listitem> <para><ulink url="https://en.wikipedia.org/wiki/Mondo_Rescue">Mondo Rescue</ulink> is a backup system to facilitate restoration of complete system quickly from backup CD/DVD etc. without going through normal system installation processes. </para> </listitem>
<listitem> <para><ulink url="https://en.wikipedia.org/wiki/Bacula">Bacula</ulink>, <ulink url="https://en.wikipedia.org/wiki/Advanced_Maryland_Automatic_Network_Disk_Archiver">Amanda</ulink>, and <ulink url="https://en.wikipedia.org/wiki/Backuppc">BackupPC</ulink> are full featured backup suite utilities which are focused on regular backups over network. </para> </listitem>
<listitem> <para><ulink url="https://en.wikipedia.org/wiki/Duplicity_(software)">Duplicity</ulink>, and <ulink url="https://en.wikipedia.org/wiki/Borg_(backup_software)">Borg</ulink> are simpler backup utilities for typical workstations. </para> </listitem>
</itemizedlist>
</section>
<section id="_backup_tips">
<title>Backup tips</title>
<para>For a personal workstation, full featured backup suite utilities designed for the server environment may not serve well. At the same time, existing backup utilities for workstations may have some shortcomings.</para>
<para>Here are some tips to make backup easier with minimal user efforts. These techniques may be used with any backup utilities.</para>
<para>For demonstration purpose, let's assume the primary user and group name to be <literal>penguin</literal> and create a backup and snapshot script example "<literal>/usr/local/bin/bkss.sh</literal>" as:</para>
<screen>#!/bin/sh -e
SRC="$1" # source data path
DSTFS="$2" # backup destination filesystem path
DSTSV="$3" # backup destination subvolume name
DSTSS="${DSTFS}/${DSTSV}-snapshot" # snapshot destination path
if [ "$(stat -f -c %T "$DSTFS")" != "btrfs" ]; then
echo "E: $DESTFS needs to be formatted to btrfs" >&amp;2 ; exit 1
fi
MSGID=$(notify-send -p "bkup.sh $DSTSV" "in progress ...")
if [ ! -d "$DSTFS/$DSTSV" ]; then
btrfs subvolume create "$DSTFS/$DSTSV"
mkdir -p "$DSTSS"
fi
rsync -aHxS --delete --mkpath "${SRC}/" "${DSTFS}/${DSTSV}"
btrfs subvolume snapshot -r "${DSTFS}/${DSTSV}" ${DSTSS}/$(date -u --iso=min)
notify-send -r "$MSGID" "bkup.sh $DSTSV" "finished!"
</screen>
<para>Here, only the basic tool <literal>rsync</literal>(1) is used to facilitate system backup and the storage space is efficiently used by <ulink url="https://en.wikipedia.org/wiki/Btrfs">Btrfs</ulink>.</para>
<tip> <para>FYI: This author uses his own similar shell script "<ulink url="https://github.com/osamuaoki/bss">bss: Btrfs Subvolume Snapshot Utility</ulink>" for his workstation. </para> </tip>
<section id="_gui_backup">
<title>GUI backup</title>
<para>Here is an example to setup the single GUI click backup.</para>
<itemizedlist>
<listitem> <para>Prepare a USB storage device to be used for backup.</para>
<itemizedlist>
<listitem> <para>Format a USB storage device with one partition in btrfs with its label name as "<literal>BKUP</literal>". This can be encrypted (see <xref linkend="_removable_disk_encryption_with_dm_crypt_luks" />). </para> </listitem>
<listitem> <para>Plug this in to your system. The desktop system should automatically mount it as "<literal>/media/penguin/BKUP</literal>".</para> </listitem>
<listitem> <para>Execute "<literal>sudo chown penguin:penguin /media/penguin/BKUP</literal>" to make it writable by the user.</para> </listitem>
</itemizedlist>
</listitem>
<listitem> <para>Create "<literal>~/.local/share/applications/BKUP.desktop</literal>" following techniques written in <xref linkend="_starting_a_program_from_gui" /> as: </para>
<screen>[Desktop Entry]
Name=bkss
Comment=Backup and snapshot of ~/Documents
Exec=/usr/local/bin/bkss.sh /home/penguin/Documents /media/penguin/BKUP Documents
Type=Application
</screen> </listitem>
</itemizedlist>
<para>For each GUI click, your data is backed up from "<literal>~/Documents</literal>" to a USB storage device and a read-only snapshot is created.</para>
</section>
<section id="_mount_event_triggered_backup">
<title>Mount event triggered backup</title>
<para>Here is an example to setup for the automatic backup triggered by the mount event.</para>
<itemizedlist>
<listitem> <para>Prepare a USB storage device to be used for backup as in <xref linkend="_gui_backup" />.</para> </listitem>
<listitem> <para>Create a systemd service unit file "<literal>~/.config/systemd/user/back-BKUP.service</literal>" as:</para>
<screen>[Unit]
Description=USB Disk backup
Requires=media-%u-BKUP.mount
After=media-%u-BKUP.mount
[Service]
ExecStart=/usr/local/bin/bkss.sh %h/Documents /media/%u/BKUP Documents
StandardOutput=append:%h/.cache/systemd-snap.log
StandardError=append:%h/.cache/systemd-snap.log
[Install]
WantedBy=media-%u-BKUP.mount
</screen> </listitem>
<listitem> <para>Enable this systemd unit configuration with the following: </para>
<screen> $ systemctl --user enable bkup-BKUP.service
</screen> </listitem>
</itemizedlist>
<para>For each mount event, your data is backed up from "<literal>~/Documents</literal>" to a USB storage device and a read-only snapshot is created.</para>
<para>Here, names of systemd mount units that systemd currently has in memory can be asked to the service manager of the calling user with "<literal>systemctl --user list-units --type=mount</literal>".</para>
</section>
<section id="_timer_event_triggered_backup">
<title>Timer event triggered backup</title>
<para>Here is an example to setup for the automatic backup triggered by the timer event.</para>
<itemizedlist>
<listitem> <para>Prepare a USB storage device to be used for backup as in <xref linkend="_gui_backup" />.</para> </listitem>
<listitem> <para>Create a systemd timer unit file "<literal>~/.config/systemd/user/snap-Documents.timer</literal>" as:</para>
<screen>[Unit]
Description=Run btrfs subvolume snapshot on timer
Documentation=man:btrfs(1)
[Timer]
OnStartupSec=30
OnUnitInactiveSec=900
[Install]
WantedBy=timers.target
</screen> </listitem>
<listitem> <para>Create a systemd service unit file "<literal>~/.config/systemd/user/snap-Documents.service</literal>" as:</para>
<screen>[Unit]
Description=Run btrfs subvolume snapshot
Documentation=man:btrfs(1)
[Service]
Type=oneshot
Nice=15
ExecStart=/usr/local/bin/bkss.sh %h/Documents /media/%u/BKUP Documents
IOSchedulingClass=idle
CPUSchedulingPolicy=idle
StandardOutput=append:%h/.cache/systemd-snap.log
StandardError=append:%h/.cache/systemd-snap.log
</screen> </listitem>
<listitem> <para>Enable this systemd unit configuration with the following: </para>
<screen> $ systemctl --user enable snap-Documents.timer
</screen> </listitem>
</itemizedlist>
<para>For each timer event, your data is backed up from "<literal>~/Documents</literal>" to a USB storage device and a read-only snapshot is created.</para>
<para>Here, names of systemd timer user units that systemd currently has in memory can be asked to the service manager of the calling user with "<literal>systemctl --user list-units --type=timer</literal>".</para>
<para>For the modern desktop system, this systemd approach can offer more fine grained control than the traditional Unix ones using <literal>at</literal>(1), <literal>cron</literal>(8), or <literal>anacron</literal>(8).</para>
</section>
</section>
</section>
<section id="_data_security_infrastructure">
<title>Data security infrastructure</title>
<para>The data security infrastructure is provided by the combination of data encryption tool, message digest tool, and signature tool.</para>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of data security infrastructure tools</title>
<tgroup cols="5">
<colspec colwidth="92pt" align="left"/>
<colspec colwidth="76pt" align="left"/>
<colspec colwidth="70pt" align="left"/>
<colspec colwidth="114pt" align="left"/>
<colspec colwidth="396pt" align="left"/>
<thead>
<row>
<entry> package </entry>
<entry> popcon </entry>
<entry> size </entry>
<entry> command </entry>
<entry> description </entry>
</row>
</thead>
<tbody>
<row>
<entry> <literal>gnupg</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>gpg</literal>(1) </entry>
<entry> <ulink url="https://en.wikipedia.org/wiki/GNU_Privacy_Guard">GNU Privacy Guard</ulink> - OpenPGP encryption and signing tool </entry>
</row>
<row>
<entry> <literal>gpgv</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>gpgv</literal>(1) </entry>
<entry> GNU Privacy Guard - signature verification tool </entry>
</row>
<row>
<entry> <literal>paperkey</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>paperkey</literal>(1) </entry>
<entry> extract just the secret information out of OpenPGP secret keys </entry>
</row>
<row>
<entry> <literal>cryptsetup</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>cryptsetup</literal>(8), … </entry>
<entry> utilities for <ulink url="https://en.wikipedia.org/wiki/Dm-crypt">dm-crypt</ulink> block device encryption supporting <ulink url="https://en.wikipedia.org/wiki/Linux_Unified_Key_Setup">LUKS</ulink> </entry>
</row>
<row>
<entry> <literal>coreutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>md5sum</literal>(1) </entry>
<entry> compute and check MD5 message digest </entry>
</row>
<row>
<entry> <literal>coreutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>sha1sum</literal>(1) </entry>
<entry> compute and check SHA1 message digest </entry>
</row>
<row>
<entry> <literal>openssl</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>openssl</literal>(1ssl) </entry>
<entry> compute message digest with "<literal>openssl dgst</literal>" (OpenSSL) </entry>
</row>
<row>
<entry> <literal>libsecret-tools</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>secret-tool</literal>(1) </entry>
<entry> store and retrieve passwords (CLI) </entry>
</row>
<row>
<entry> <literal>seahorse</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <literal>seahorse</literal>(1) </entry>
<entry> key management tool (GNOME) </entry>
</row>
</tbody>
</tgroup>
</table>
<para>See <xref linkend="_data_encryption_tips"/> on <ulink url="https://en.wikipedia.org/wiki/Dm-crypt">dm-crypt</ulink> and <ulink url="https://www.kernel.org/doc/html/latest/filesystems/fscrypt.html">fscrypt</ulink> which implement automatic data encryption infrastructure via Linux kernel modules.</para>
<section id="_key_management_for_gnupg">
<title>Key management for GnuPG</title>
<para>Here are <ulink url="https://en.wikipedia.org/wiki/GNU_Privacy_Guard">GNU Privacy Guard</ulink> commands for the basic key management.</para>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of GNU Privacy Guard commands for the key management</title>
<tgroup cols="2">
<colspec colwidth="162pt" align="left"/>
<colspec colwidth="217pt" align="left"/>
<thead>
<row>
<entry> command </entry>
<entry> description </entry>
</row>
</thead>
<tbody>
<row>
<entry> <literal>gpg --gen-key</literal> </entry>
<entry> generate a new key </entry>
</row>
<row>
<entry> <literal>gpg --gen-revoke my_user_ID</literal> </entry>
<entry> generate revoke key for my_user_ID </entry>
</row>
<row>
<entry> <literal>gpg --edit-key user_ID</literal> </entry>
<entry> edit key interactively, "help" for help </entry>
</row>
<row>
<entry> <literal>gpg -o file --export</literal> </entry>
<entry> export all keys to file </entry>
</row>
<row>
<entry> <literal>gpg --import file</literal> </entry>
<entry> import all keys from file </entry>
</row>
<row>
<entry> <literal>gpg --send-keys user_ID</literal> </entry>
<entry> send key of user_ID to keyserver </entry>
</row>
<row>
<entry> <literal>gpg --recv-keys user_ID</literal> </entry>
<entry> recv. key of user_ID from keyserver </entry>
</row>
<row>
<entry> <literal>gpg --list-keys user_ID</literal> </entry>
<entry> list keys of user_ID </entry>
</row>
<row>
<entry> <literal>gpg --list-sigs user_ID</literal> </entry>
<entry> list sig. of user_ID </entry>
</row>
<row>
<entry> <literal>gpg --check-sigs user_ID</literal> </entry>
<entry> check sig. of user_ID </entry>
</row>
<row>
<entry> <literal>gpg --fingerprint user_ID</literal> </entry>
<entry> check fingerprint of user_ID </entry>
</row>
<row>
<entry> <literal>gpg --refresh-keys</literal> </entry>
<entry> update local keyring </entry>
</row>
</tbody>
</tgroup>
</table>
<para>Here is the meaning of the trust code.</para>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of the meaning of the trust code</title>
<tgroup cols="2">
<colspec colwidth="27pt" align="left"/>
<colspec colwidth="249pt" align="left"/>
<thead>
<row>
<entry> code </entry>
<entry> description of trust </entry>
</row>
</thead>
<tbody>
<row>
<entry> <literal>-</literal> </entry>
<entry> no owner trust assigned / not yet calculated </entry>
</row>
<row>
<entry> <literal>e</literal> </entry>
<entry> trust calculation failed </entry>
</row>
<row>
<entry> <literal>q</literal> </entry>
<entry> not enough information for calculation </entry>
</row>
<row>
<entry> <literal>n</literal> </entry>
<entry> never trust this key </entry>
</row>
<row>
<entry> <literal>m</literal> </entry>
<entry> marginally trusted </entry>
</row>
<row>
<entry> <literal>f</literal> </entry>
<entry> fully trusted </entry>
</row>
<row>
<entry> <literal>u</literal> </entry>
<entry> ultimately trusted </entry>
</row>
</tbody>
</tgroup>
</table>
<para>The following uploads my key "<literal>1DD8D791</literal>" to the popular keyserver "<literal>hkp://keys.gnupg.net</literal>".</para>
<screen>$ gpg --keyserver hkp://keys.gnupg.net --send-keys 1DD8D791</screen>
<para>A good default keyserver set up in "<literal>~/.gnupg/gpg.conf</literal>" (or old location "<literal>~/.gnupg/options</literal>") contains the following.</para>
<screen>keyserver hkp://keys.gnupg.net</screen>
<para>The following obtains unknown keys from the keyserver.</para>
<screen>$ gpg --list-sigs --with-colons | grep '^sig.*\[User ID not found\]' |\
cut -d ':' -f 5| sort | uniq | xargs gpg --recv-keys</screen>
<!-- Following URL is stil sourceforge XXX FIXME XXX -->
<para>There was a bug in <ulink url="https://sourceforge.net/projects/pks/">OpenPGP Public Key Server</ulink> (pre version 0.9.6) which corrupted key with more than 2 sub-keys. The newer <literal>gnupg</literal> (&gt;1.2.1-2) package can handle these corrupted subkeys. See <literal>gpg</literal>(1) under "<literal>--repair-pks-subkey-bug</literal>" option.</para>
</section>
<section id="_using_gnupg_on_files">
<title>Using GnuPG on files</title>
<para>Here are examples for using <ulink url="https://en.wikipedia.org/wiki/GNU_Privacy_Guard">GNU Privacy Guard</ulink> commands on files.</para>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of GNU Privacy Guard commands on files</title>
<tgroup cols="2">
<colspec colwidth="304pt" align="left"/>
<colspec colwidth="445pt" align="left"/>
<thead>
<row>
<entry> command </entry>
<entry> description </entry>
</row>
</thead>
<tbody>
<row>
<entry> <literal>gpg -a -s file</literal> </entry>
<entry> sign file into <ulink url="https://en.wikipedia.org/wiki/ASCII">ASCII</ulink> armored file.asc </entry>
</row>
<row>
<entry> <literal>gpg --armor --sign file</literal> </entry>
<entry> , , </entry>
</row>
<row>
<entry> <literal>gpg --clearsign file</literal> </entry>
<entry> clear-sign message </entry>
</row>
<row>
<entry> <literal>gpg --clearsign file|mail foo@example.org</literal> </entry>
<entry> mail a clear-signed message to <literal>foo@example.org</literal> </entry>
</row>
<row>
<entry> <literal>gpg --clearsign --not-dash-escaped patchfile</literal> </entry>
<entry> clear-sign patchfile </entry>
</row>
<row>
<entry> <literal>gpg --verify file</literal> </entry>
<entry> verify clear-signed file </entry>
</row>
<row>
<entry> <literal>gpg -o file.sig -b file</literal> </entry>
<entry> create detached signature </entry>
</row>
<row>
<entry> <literal>gpg -o file.sig --detach-sign file</literal> </entry>
<entry> , , </entry>
</row>
<row>
<entry> <literal>gpg --verify file.sig file</literal> </entry>
<entry> verify file with file.sig </entry>
</row>
<row>
<entry> <literal>gpg -o crypt_file.gpg -r name -e file</literal> </entry>
<entry> public-key encryption intended for name from file to binary crypt_file.gpg </entry>
</row>
<row>
<entry> <literal>gpg -o crypt_file.gpg --recipient name --encrypt file</literal> </entry>
<entry> , , </entry>
</row>
<row>
<entry> <literal>gpg -o crypt_file.asc -a -r name -e file</literal> </entry>
<entry> public-key encryption intended for name from file to <ulink url="https://en.wikipedia.org/wiki/ASCII">ASCII</ulink> armored crypt_file.asc </entry>
</row>
<row>
<entry> <literal>gpg -o crypt_file.gpg -c file</literal> </entry>
<entry> symmetric encryption from file to crypt_file.gpg </entry>
</row>
<row>
<entry> <literal>gpg -o crypt_file.gpg --symmetric file</literal> </entry>
<entry> , , </entry>
</row>
<row>
<entry> <literal>gpg -o crypt_file.asc -a -c file</literal> </entry>
<entry> symmetric encryption intended for name from file to <ulink url="https://en.wikipedia.org/wiki/ASCII">ASCII</ulink> armored crypt_file.asc </entry>
</row>
<row>
<entry> <literal>gpg -o file -d crypt_file.gpg -r name</literal> </entry>
<entry> decryption </entry>
</row>
<row>
<entry> <literal>gpg -o file --decrypt crypt_file.gpg</literal> </entry>
<entry> , , </entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="_using_gnupg_with_mutt">
<title>Using GnuPG with Mutt</title>
<para>Add the following to "<literal>~/.muttrc</literal>" to keep a slow GnuPG from automatically starting, while allowing it to be used by typing "<literal>S</literal>" at the index menu.</para>
<screen>macro index S ":toggle pgp_verify_sig\n"
set pgp_verify_sig=no</screen>
</section>
<section id="_using_gnupg_with_vim">
<title>Using GnuPG with Vim</title>
<para>The <literal>gnupg</literal> plugin let you run GnuPG transparently for files with extension "<literal>.gpg</literal>", "<literal>.asc</literal>", and "<literal>.pgp</literal>".<footnote><para>If you use "<literal>~/.vimrc</literal>" instead of "<literal>~/.vim/vimrc</literal>", please substitute accordingly.</para></footnote></para>
<screen>$ sudo aptitude install vim-scripts
$ echo "packadd! gnupg" >> ~/.vim/vimrc</screen>
</section>
<section id="_the_md5_sum">
<title>The MD5 sum</title>
<para><literal>md5sum</literal>(1) provides utility to make a digest file using the method in <ulink url="https://datatracker.ietf.org/doc/rfc1321/">rfc1321</ulink> and verifying each file with it.</para>
<screen>$ md5sum foo bar &gt;baz.md5
$ cat baz.md5
d3b07384d113edec49eaa6238ad5ff00 foo
c157a79031e1c40f85931829bc5fc552 bar
$ md5sum -c baz.md5
foo: OK
bar: OK</screen>
<note>
<para>The computation for the <ulink url="https://en.wikipedia.org/wiki/MD5">MD5</ulink> sum is less CPU intensive than the one for the cryptographic signature by <ulink url="https://en.wikipedia.org/wiki/GNU_Privacy_Guard">GNU Privacy Guard (GnuPG)</ulink>. Usually, only the top level digest file is cryptographically signed to ensure data integrity.</para>
</note>
</section>
<section id="_password_keyring">
<title>Password keyring</title>
<para>On GNOME system, the GUI tool <literal>seahorse</literal>(1) manages passwords and stores them securely in the keyring <literal>~/.local/share/keyrings/*</literal>.</para>
<para><literal>secret-tool</literal>(1) can store password to the keyring from the command line.</para>
<para>Let's store passphrase used for LUKS/dm-crypt encrypted disk image</para>
<screen>$ secret-tool store --label='LUKS passphrase for disk.img' LUKS my_disk.img
Password: ********
</screen>
<para>This stored password can be retrieved and fed to other programs, e.g., <literal>cryptsetup</literal>(8).</para>
<screen>$ secret-tool lookup LUKS my_disk.img | \
cryptsetup open disk.img disk_img --type luks --keyring -
$ sudo mount /dev/mapper/disk_img /mnt
</screen>
<tip> <para>Whenever you need to provide password in a script, use <literal>secret-tool</literal> and avoid directly hardcoding the passphrase in it.</para> </tip>
</section>
</section>
<section id="_source_code_merge_tools">
<title>Source code merge tools</title>
<para>There are many merge tools for the source code. Following commands caught my eyes.</para>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of source code merge tools</title>
<tgroup cols="5">
<colspec colwidth="70pt" align="left"/>
<colspec colwidth="76pt" align="left"/>
<colspec colwidth="70pt" align="left"/>
<colspec colwidth="92pt" align="left"/>
<colspec colwidth="358pt" align="left"/>
<thead>
<row>
<entry> package </entry>
<entry> popcon </entry>
<entry> size </entry>
<entry> command </entry>
<entry> description </entry>
</row>
</thead>
<tbody>
<row>
<entry> <literal>patch</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>patch</literal>(1) </entry>
<entry> apply a diff file to an original </entry>
</row>
<row>
<entry> <literal>vim</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>vimdiff</literal>(1) </entry>
<entry> compare 2 files side by side in vim </entry>
</row>
<row>
<entry> <literal>imediff</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>imediff</literal>(1) </entry>
<entry> interactive full screen 2/3-way merge tool </entry>
</row>
<row>
<entry> <literal>meld</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>meld</literal>(1) </entry>
<entry> compare and merge files (GTK) </entry>
</row>
<row>
<entry> <literal>wiggle</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>wiggle</literal>(1) </entry>
<entry> apply rejected patches </entry>
</row>
<row>
<entry> <literal>diffutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>diff</literal>(1) </entry>
<entry> compare files line by line </entry>
</row>
<row>
<entry> <literal>diffutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>diff3</literal>(1) </entry>
<entry> compare and merges three files line by line </entry>
</row>
<!--
<row>
<entry> <literal>dpatch</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>dpatch</literal>(1) </entry>
<entry> manage series of patches for Debian package </entry>
</row>
-->
<row>
<entry> <literal>quilt</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>quilt</literal>(1) </entry>
<entry> manage series of patches </entry>
</row>
<row>
<entry> <literal>wdiff</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>wdiff</literal>(1) </entry>
<entry> display word differences between text files </entry>
</row>
<row>
<entry> <literal>diffstat</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>diffstat</literal>(1) </entry>
<entry> produce a histogram of changes by the diff </entry>
</row>
<row>
<entry> <literal>patchutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>combinediff</literal>(1) </entry>
<entry> create a cumulative patch from two incremental patches </entry>
</row>
<row>
<entry> <literal>patchutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>dehtmldiff</literal>(1) </entry>
<entry> extract a diff from an HTML page </entry>
</row>
<row>
<entry> <literal>patchutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>filterdiff</literal>(1) </entry>
<entry> extract or excludes diffs from a diff file </entry>
</row>
<row>
<entry> <literal>patchutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>fixcvsdiff</literal>(1) </entry>
<entry> fix diff files created by CVS that <literal>patch</literal>(1) mis-interprets </entry>
</row>
<row>
<entry> <literal>patchutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>flipdiff</literal>(1) </entry>
<entry> exchange the order of two patches </entry>
</row>
<row>
<entry> <literal>patchutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>grepdiff</literal>(1) </entry>
<entry> show which files are modified by a patch matching a regex </entry>
</row>
<row>
<entry> <literal>patchutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>interdiff</literal>(1) </entry>
<entry> show differences between two unified diff files </entry>
</row>
<row>
<entry> <literal>patchutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>lsdiff</literal>(1) </entry>
<entry> show which files are modified by a patch </entry>
</row>
<row>
<entry> <literal>patchutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>recountdiff</literal>(1) </entry>
<entry> recompute counts and offsets in unified context diffs </entry>
</row>
<row>
<entry> <literal>patchutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>rediff</literal>(1) </entry>
<entry> fix offsets and counts of a hand-edited diff </entry>
</row>
<row>
<entry> <literal>patchutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>splitdiff</literal>(1) </entry>
<entry> separate out incremental patches </entry>
</row>
<row>
<entry> <literal>patchutils</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>unwrapdiff</literal>(1) </entry>
<entry> demangle patches that have been word-wrapped </entry>
</row>
<row>
<entry> <literal>dirdiff</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>dirdiff</literal>(1) </entry>
<entry> display differences and merge changes between directory trees </entry>
</row>
<row>
<entry> <literal>docdiff</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>docdiff</literal>(1) </entry>
<entry> compare two files word by word / char by char </entry>
</row>
<row>
<entry> <literal>makepatch</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>makepatch</literal>(1) </entry>
<entry> generate extended patch files </entry>
</row>
<row>
<entry> <literal>makepatch</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>applypatch</literal>(1) </entry>
<entry> apply extended patch files </entry>
</row>
</tbody>
</tgroup>
</table>
<section id="_extracting_differences_for_source_files">
<title>Extracting differences for source files</title>
<para>The following procedures extract differences between two source files and create unified diff files "<literal>file.patch0</literal>" or "<literal>file.patch1</literal>" depending on the file location.</para>
<screen>$ diff -u file.old file.new &gt; file.patch0
$ diff -u old/file new/file &gt; file.patch1</screen>
</section>
<section id="_merging_updates_for_source_files">
<title>Merging updates for source files</title>
<para>The diff file (alternatively called patch file) is used to send a program update. The receiving party applies this update to another file by the following.</para>
<screen>$ patch -p0 file &lt; file.patch0
$ patch -p1 file &lt; file.patch1</screen>
</section>
<section id="_interactive_merge">
<title>Interactive merge</title>
<para>If you have two versions of a source code, you can perform 2-way merge interactively using <literal>imediff</literal>(1) by the following.</para>
<screen>$ imediff -o file.merged file.old file.new</screen>
<para>If you have three versions of a source code, you can perform 3-way merge interactively using <literal>imediff</literal>(1) by the following.</para>
<screen>$ imediff -o file.merged file.yours file.base file.theirs</screen>
</section>
</section>
<section id="_git">
<title>Git</title>
<para>Git is the tool of choice these days for the <ulink url="https://en.wikipedia.org/wiki/Revision_control">version control system (VCS)</ulink> since Git can do everything for both local and remote source code management.</para>
<para>Debian provides free Git services via <ulink url="https://salsa.debian.org/">Debian Salsa service</ulink>. Its documentation can be found at <ulink url="https://wiki.debian.org/Salsa">https://wiki.debian.org/Salsa</ulink> .</para>
<para>Here are some Git related packages.</para>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of git related packages and commands</title>
<tgroup cols="5">
<colspec colwidth="103pt" align="left"/>
<colspec colwidth="76pt" align="left"/>
<colspec colwidth="70pt" align="left"/>
<colspec colwidth="135pt" align="left"/>
<colspec colwidth="363pt" align="left"/>
<thead>
<row>
<entry> package </entry>
<entry> popcon </entry>
<entry> size </entry>
<entry> command </entry>
<entry> description </entry>
</row>
</thead>
<tbody>
<row>
<entry> <literal>git</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>git</literal>(7) </entry>
<entry> Git, the fast, scalable, distributed revision control system </entry>
</row>
<row>
<entry> <literal>gitk</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry> <entry><literal>gitk</literal>(1) </entry>
<entry> GUI Git repository browser with history </entry>
</row>
<row>
<entry> <literal>git-gui</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>git-gui</literal>(1) </entry>
<entry> GUI for Git (No history) </entry>
</row>
<row>
<entry> <literal>git-email</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>git-send-email</literal>(1) </entry>
<entry> send a collection of patches as email from the Git </entry>
</row>
<row>
<entry> <literal>git-buildpackage</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>git-buildpackage</literal>(1) </entry>
<entry> automate the Debian packaging with the Git </entry>
</row>
<row>
<entry> <literal>dgit</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>dgit</literal>(1) </entry>
<entry> git interoperability with the Debian archive </entry>
</row>
<row>
<entry> <literal>imediff</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>git-ime</literal>(1) </entry>
<entry> interactive git commit split helper tool </entry>
</row>
<row>
<entry> <literal>stgit</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry><literal>stg</literal>(1) </entry>
<entry> quilt on top of git (Python) </entry>
</row>
<row>
<entry> <literal>git-doc</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> N/A </entry>
<entry> official documentation for Git </entry>
</row>
<row>
<entry> <literal>gitmagic</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> N/A </entry>
<entry> "Git Magic", easier to understand guide for Git </entry>
</row>
</tbody>
</tgroup>
</table>
<section id="_configuration_of_git_client">
<title>Configuration of Git client</title>
<para>You may wish to set several global configuration in "<literal>~/.gitconfig</literal>" such as your name and email address used by Git by the following.</para>
<screen>$ git config --global user.name "Name Surname"
$ git config --global user.email yourname@example.com</screen>
<para>You may also customize the Git default behavior by the following.</para>
<screen>$ git config --global init.defaultBranch main
$ git config --global pull.rebase true
$ git config --global push.default current</screen>
<para>If you are too used to CVS or Subversion commands, you may wish to set several command aliases by the following.</para>
<screen>$ git config --global alias.ci "commit -a"
$ git config --global alias.co checkout</screen>
<para>You can check your global configuration by the following.</para>
<screen>$ git config --global --list</screen>
</section>
<section id="_basic_git_commands">
<title>Basic Git commands</title>
<para>Git operation involves several data.</para>
<itemizedlist>
<listitem> <para> The working tree which holds user facing files and to which you make changes. </para>
<itemizedlist>
<listitem> <para> The changes to be recorded must be explicitly selected and staged to the index. This is <literal>git add</literal> and <literal>git rm</literal> commands. </para> </listitem>
</itemizedlist>
</listitem>
<listitem> <para> The index which holds staged files.</para>
<itemizedlist>
<listitem> <para> Staged files will be committed to the local repository upon the subsequent request. This is <literal>git commit</literal> command. </para> </listitem>
</itemizedlist>
</listitem>
<listitem> <para> The local repository which holds committed files. </para>
<itemizedlist>
<listitem> <para> Git records the linked history of the committed data and organizes them as branches in the repository.</para> </listitem>
<listitem> <para> The local repository can send data to the remote repository by <literal>git push</literal> command. </para> </listitem>
<listitem> <para> The local repository can receive data from the remote repository by <literal>git fetch</literal> and <literal>git pull</literal> commands.</para>
<itemizedlist>
<listitem> <para> The <literal>git pull</literal> command performs <literal>git merge</literal> or <literal>git rebase</literal> command after <literal>git fetch</literal> command. </para> </listitem>
<listitem> <para> Here, <literal>git merge</literal> combines two separate branches of history at the end to a point. (This is default of <literal>git pull</literal> without customization and may be good for upstream people who publish branch to many people.) </para> </listitem>
<listitem> <para> Here, <literal>git rebase</literal> creates one single branch of sequential history of the remote branch one followed by the local branch one. (This is <literal>pull.rebase true</literal> customization case and may be good for rest of us.) </para> </listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</listitem>
<listitem> <para> The remote repository which holds committed files. </para>
<itemizedlist>
<listitem> <para> The communication to the remote repository uses secure communication protocols such as SSH or HTTPS. </para> </listitem>
</itemizedlist>
</listitem>
</itemizedlist>
<para>The working tree is files outside of the <literal>.git/</literal> directory. Files inside of the <literal>.git/</literal> directory hold the index, the local repository data, and some git configuration text files. </para>
<para>Here is an overview of main Git commands.</para>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>Main Git commands</title>
<tgroup cols="2">
<colspec colwidth="250pt" align="left"/>
<colspec colwidth="350pt" align="left"/>
<thead>
<row>
<entry> Git command </entry>
<entry> function </entry>
</row>
</thead>
<tbody>
<row>
<entry> <literal>git init</literal> </entry>
<entry> create the (local) repository </entry>
</row>
<row>
<entry> <literal>git clone URL</literal> </entry>
<entry> clone the remote repository to a local repository with the working tree </entry>
</row>
<row>
<entry> <literal>git pull origin main</literal> </entry>
<entry> update the local <literal>main</literal> branch by the remote repository <literal>origin</literal> </entry>
</row>
<row>
<entry> <literal>git add .</literal> </entry>
<entry> add file(s) in the working tree to the index for pre-existing files in index only </entry>
</row>
<row>
<entry> <literal>git add -A .</literal> </entry>
<entry> add file(s) in the working tree to the index for all files including removals</entry>
</row>
<row>
<entry> <literal>git rm filename</literal> </entry>
<entry> remove file(s) from the working tree and the index </entry>
</row>
<row>
<entry> <literal>git commit</literal> </entry>
<entry> commit staged changes in the index to the local repository </entry>
</row>
<row>
<entry> <literal>git commit -a</literal> </entry>
<entry> add all changes in the working tree to the index and commit them to the local repository (add + commit) </entry>
</row>
<row>
<entry> <literal>git push -u origin branch_name</literal> </entry>
<entry> update the remote repository <literal>origin</literal> by the local <literal>branch_name</literal> branch (initial invocation) </entry>
</row>
<row>
<entry> <literal>git push origin branch_name</literal> </entry>
<entry> update the remote repository <literal>origin</literal> by the local <literal>branch_name</literal> branch (subsequent invocation) </entry>
</row>
<row>
<entry> <literal>git diff treeish1 treeish2</literal> </entry>
<entry> show difference between <emphasis>treeish1</emphasis> commit and <emphasis>treeish2</emphasis> commit </entry>
</row>
<row>
<entry> <literal>gitk</literal> </entry>
<entry> GUI display of VCS repository branch history tree </entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="_git_tips">
<title>Git tips</title>
<para>Here are some Git tips.</para>
<table pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>Git tips</title>
<tgroup cols="2">
<colspec colwidth="250pt" align="left"/>
<colspec colwidth="350pt" align="left"/>
<thead>
<row>
<entry> Git command line </entry>
<entry> function </entry>
</row>
</thead>
<tbody>
<row>
<entry> <literal>gitk --all</literal> </entry>
<entry> see complete Git history and operate on them such as resetting HEAD to another commit, cheery-picking patches, creating tags and branches ... </entry>
</row>
<row>
<entry> <literal>git stash</literal> </entry>
<entry> get the clean working tree without loosing data </entry>
</row>
<row>
<entry> <literal>git remote -v</literal> </entry>
<entry> check settings for remote </entry>
</row>
<row>
<entry> <literal>git branch -vv</literal> </entry>
<entry> check settings for branch </entry>
</row>
<row>
<entry> <literal>git status</literal> </entry>
<entry> show working tree status </entry>
</row>
<row>
<entry> <literal>git config -l</literal> </entry>
<entry> list git settings </entry>
</row>
<row>
<entry> <literal>git reset --hard HEAD; git clean -x -d -f</literal> </entry>
<entry> revert all working tree changes and clean them up completely </entry>
</row>
<row>
<entry> <literal>git rm --cached filename</literal> </entry>
<entry> revert staged index changed by <literal>git add filename</literal> </entry>
</row>
<row>
<entry> <literal>git reflog</literal> </entry>
<entry> get reference log (useful for recovering commits from the removed branch)</entry>
</row>
<row>
<entry> <literal>git branch new_branch_name HEAD@{6}</literal> </entry>
<entry> create a new branch from reflog information</entry>
</row>
<row>
<entry> <literal>git remote add new_remote URL</literal> </entry>
<entry> add a <literal>new_remote</literal> remote repository pointed by URL </entry>
</row>
<row>
<entry> <literal>git remote rename origin upstream</literal> </entry>
<entry> rename the remote repository name from <literal>origin</literal> to <literal>upstream</literal> </entry>
</row>
<row>
<entry> <literal>git branch -u upstream/branch_name</literal> </entry>
<entry> set the remote tracking to the remote repository <literal>upstream</literal> and its branch name <literal>branch_name</literal>. </entry>
</row>
<row>
<entry> <literal>git remote set-url origin https://foo/bar.git</literal> </entry>
<entry> change URL of <literal>origin</literal> </entry>
</row>
<row>
<entry> <literal>git remote set-url --push upstream DISABLED</literal> </entry>
<entry> disable push to <literal>upstream</literal> (Edit <literal>.git/config</literal> to re-enable) </entry>
</row>
<row>
<entry> <literal>git remote update upstream</literal> </entry>
<entry> fetch updates of all remote branches in the <literal>upstream</literal> repository </entry>
</row>
<row>
<entry> <literal>git fetch upstream foo:upstream-foo</literal> </entry>
<entry> create a local (possibly orphan) <literal>upstream-foo</literal> branch as a copy of <literal>foo</literal> branch in the <literal>upstream</literal> repository </entry>
</row>
<row>
<entry> <literal>git checkout -b topic_branch ; git push -u topic_branch origin</literal> </entry>
<entry> make a new <literal>topic_branch</literal> and push it to <literal>origin</literal></entry>
</row>
<row>
<entry> <literal>git branch -m oldname newname</literal> </entry>
<entry> rename local branch name </entry>
</row>
<row>
<entry> <literal>git push -d origin branch_to_be_removed</literal> </entry>
<entry> remove remote branch (new method)</entry>
</row>
<row>
<entry> <literal>git push origin :branch_to_be_removed</literal> </entry>
<entry> remove remote branch (old method)</entry>
</row>
<row>
<entry> <literal>git checkout --orphan unconnected</literal> </entry>
<entry> create a new <literal>unconnected</literal> branch</entry>
</row>
<row>
<entry> <literal>git rebase -i origin/main</literal> </entry>
<entry> reorder/drop/squish commits from <literal>origin/main</literal> to clean branch history </entry>
</row>
<row>
<entry> <literal>git reset HEAD^; git commit --amend </literal> </entry>
<entry> squash last 2 commits into one</entry>
</row>
<row>
<entry> <literal>git checkout topic_branch ; git merge --squash topic_branch </literal> </entry>
<entry> squash entire <literal>topic_branch</literal> into a commit </entry>
</row>
<row>
<entry> <literal>git fetch --unshallow --update-head-ok origin '+refs/heads/*:refs/heads/*' </literal> </entry>
<entry> convert a shallow clone to the full clone of all branches </entry>
</row>
<row>
<entry> <literal>git ime</literal> </entry>
<entry> split the last commit into a series of file-by-file smaller commits etc. (<literal>imediff</literal> package required)</entry>
</row>
<row>
<entry> <literal>git repack -a -d; git prune</literal> </entry>
<entry> repack the local repository into single pack (this may limit chance of lost data recovery from erased branch etc.)</entry>
</row>
</tbody>
</tgroup>
</table>
<warning> <para>Do not use the tag string with spaces in it even if some tools such as <literal>gitk</literal>(1) allow you to use it. It may choke some other <literal>git</literal> commands.</para> </warning>
<caution> <para>If a local branch which has been pushed to remote repository is rebased or squashed, pushing this branch has risks and requires <literal>--force</literal> option. This is usually not an acceptable for <literal>main</literal> branch but may be acceptable for a topic branch before merging to <literal>main</literal> branch.</para> </caution>
<caution> <para>Invoking a <literal>git</literal> subcommand directly as "<literal>git-xyz</literal>" from the command line has been deprecated since early 2006.</para> </caution>
<tip> <para>If there is a executable file <literal>git-foo</literal> in the path specified by <literal>$PATH</literal>, entering "<literal>git foo</literal>" without hyphen to the command line invokes this <literal>git-foo</literal>. This is a feature of the <literal>git</literal> command.</para> </tip>
</section>
<section id="_git_references">
<title>Git references</title>
<para>See the following.</para>
<itemizedlist>
<listitem> <para><ulink url="https://mirrors.edge.kernel.org/pub/software/scm/git/docs/git.html">manpage: git(1)</ulink> (<literal>/usr/share/doc/git-doc/git.html</literal>) </para> </listitem>
<listitem> <para><ulink url="https://mirrors.edge.kernel.org/pub/software/scm/git/docs/user-manual.html">Git User's Manual</ulink> (<literal>/usr/share/doc/git-doc/user-manual.html</literal>) </para> </listitem>
<listitem> <para><ulink url="https://mirrors.edge.kernel.org/pub/software/scm/git/docs/gittutorial.html">A tutorial introduction to git</ulink> (<literal>/usr/share/doc/git-doc/gittutorial.html</literal>) </para> </listitem>
<listitem> <para><ulink url="https://mirrors.edge.kernel.org/pub/software/scm/git/docs/gittutorial-2.html">A tutorial introduction to git: part two</ulink> (<literal>/usr/share/doc/git-doc/gittutorial-2.html</literal>) </para> </listitem>
<listitem> <para><ulink url="https://mirrors.edge.kernel.org/pub/software/scm/git/docs/giteveryday.html">Everyday GIT With 20 Commands Or So</ulink> (<literal>/usr/share/doc/git-doc/giteveryday.html</literal>) </para> </listitem>
<listitem> <para><ulink url="https://github.com/blynn/gitmagic">Git Magic</ulink> (<literal>/usr/share/doc/gitmagic/html/index.html</literal>) </para> </listitem>
</itemizedlist>
</section>
<section id="_other_version_control_systems">
<title>Other version control systems</title>
<para>The <ulink url="https://en.wikipedia.org/wiki/Revision_control">version control systems (VCS)</ulink> is sometimes known as the revision control system (RCS), or the software configuration management (SCM).</para>
<para>Here is a summary of the notable other non-Git VCS on the Debian system.</para>
<table id="list-of-vcs" pgwide="0" frame="topbot" rowsep="1" colsep="1">
<title>List of other version control system tools</title>
<tgroup cols="6">
<colspec colwidth="70pt" align="left"/>
<colspec colwidth="76pt" align="left"/>
<colspec colwidth="70pt" align="left"/>
<colspec colwidth="342pt" align="left"/>
<colspec colwidth="65pt" align="left"/>
<colspec colwidth="504pt" align="left"/>
<thead>
<row>
<entry> package </entry>
<entry> popcon </entry>
<entry> size </entry>
<entry> tool </entry>
<entry> VCS type </entry>
<entry> comment </entry>
</row>
</thead>
<tbody>
<row>
<entry> <literal>mercurial</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <ulink url="https://en.wikipedia.org/wiki/Mercurial_(software)">Mercurial</ulink> </entry>
<entry> distributed </entry>
<entry> DVCS in Python and some C </entry>
</row>
<row>
<entry> <literal>darcs</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <ulink url="https://en.wikipedia.org/wiki/Darcs">Darcs</ulink> </entry>
<entry> distributed </entry>
<entry> DVCS with smart algebra of patches (slow) </entry>
</row>
<row>
<entry> <literal>bzr</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <ulink url="https://en.wikipedia.org/wiki/GNU_Bazaar">GNU Bazaar</ulink> </entry>
<entry> distributed </entry>
<entry> DVCS influenced by <literal>tla</literal> written in Python (<ulink url="https://wiki.ubuntu.com/UbuntuDevelopment/MigratingFromBzrToGit">historic</ulink>) </entry>
</row>
<row>
<entry> <literal>tla</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <ulink url="https://en.wikipedia.org/wiki/GNU_arch">GNU arch</ulink> </entry>
<entry> distributed </entry>
<entry> DVCS mainly by Tom Lord (historic) </entry>
</row>
<!-- No more in Debian
<row>
<entry> <literal>monotone</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <ulink url="https://en.wikipedia.org/wiki/Monotone_(software)">Monotone</ulink> </entry>
<entry> distributed </entry>
<entry> DVCS in C++ (historic)</entry>
</row>
-->
<row>
<entry> <literal>subversion</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <ulink url="https://en.wikipedia.org/wiki/Subversion_(software)">Subversion</ulink> </entry>
<entry> remote </entry>
<entry> "CVS done right", newer standard remote VCS (historic) </entry>
</row>
<row>
<entry> <literal>cvs</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <ulink url="https://en.wikipedia.org/wiki/Concurrent_Versions_System">CVS</ulink> </entry>
<entry> remote </entry>
<entry> previous standard remote VCS (historic)</entry>
</row>
<row>
<entry> <literal>tkcvs</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> CVS, … </entry>
<entry> remote </entry>
<entry> GUI display of VCS (CVS, Subversion, RCS) repository tree </entry>
</row>
<row>
<entry> <literal>rcs</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <ulink url="https://en.wikipedia.org/wiki/Revision_Control_System">RCS</ulink> </entry>
<entry> local </entry>
<entry> "<ulink url="https://en.wikipedia.org/wiki/Source_Code_Control_System">Unix SCCS</ulink> done right" (historic)</entry>
</row>
<row>
<entry> <literal>cssc</literal> </entry>
<entry> @-@popcon1@-@ </entry>
<entry> @-@psize1@-@ </entry>
<entry> <ulink url="https://www.gnu.org/software/cssc/">CSSC</ulink> </entry>
<entry> local </entry>
<entry> clone of the <ulink url="https://en.wikipedia.org/wiki/Source_Code_Control_System">Unix SCCS</ulink> (historic) </entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
</chapter>