<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Antonomy</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Antonomy"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Antonomy"/>
	<updated>2026-05-01T23:35:48Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Alpine_local_backup&amp;diff=31535</id>
		<title>Alpine local backup</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Alpine_local_backup&amp;diff=31535"/>
		<updated>2025-11-27T04:22:02Z</updated>

		<summary type="html">&lt;p&gt;Antonomy: grammar and formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Local backup utility ({{ic|lbu}}) is the Alpine Linux tool for managing [[Diskless Mode]] installations. For these installations, {{ic|lbu}} must be used to [[#Committing changes|commit the changes]] whenever [[Alpine Package Keeper]] is used.&lt;br /&gt;
&lt;br /&gt;
When Alpine Linux boots in diskless mode, it initially only loads a few required packages from the boot device. However, local adjustments to what-gets-loaded-into-RAM are possible, e.g. installing a package or adjusting the configuration files in {{path|/etc}}. The modifications can be saved with {{ic|lbu}} to an overlay file i.e [[Diskless Mode#Apkovl|apkovl]] file, which can be automatically loaded when booting to restore the saved state.&lt;br /&gt;
&lt;br /&gt;
By default, an {{ic|lbu commit}} only stores modifications below {{Path|/etc}}, with the exception of the {{Path|/etc/init.d/}} directory. If a user was created during the {{ic|setup-alpine}} script, that user&#039;s home directory is also added to the paths that {{ic|lbu}} will back up. However, {{ic|[[#Include_special_files.2Ffolders_to_the_apkovl|lbu include]]}} enables modifying that set of included files, and can be used to specify additional files or folders.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;lbu&amp;lt;/code&amp;gt; tool has several subcommands to manage the .apkovl:&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| lbu commit &lt;br /&gt;
| lbu ci &lt;br /&gt;
| Create a backup of config to writeable media&lt;br /&gt;
|-&lt;br /&gt;
| lbu package &lt;br /&gt;
| lbu pkg&lt;br /&gt;
| Create backup package&lt;br /&gt;
|-&lt;br /&gt;
| lbu status &lt;br /&gt;
| lbu st &lt;br /&gt;
| Check what files have been changed since last commit&lt;br /&gt;
|-&lt;br /&gt;
| lbu list&lt;br /&gt;
| lbu ls&lt;br /&gt;
| Lists files that would go to tar package. Same as: {{Codeline|lbu package -v /dev/null}}&lt;br /&gt;
|-&lt;br /&gt;
| lbu diff&lt;br /&gt;
|&lt;br /&gt;
| Run a diff against last commit&lt;br /&gt;
|-&lt;br /&gt;
| lbu include&lt;br /&gt;
| lbu inc or lbu add&lt;br /&gt;
| Add filename(s) to include list{{Path|/etc/apk/protected_paths.d/lbu.list}}&lt;br /&gt;
|-&lt;br /&gt;
| lbu exclude&lt;br /&gt;
| lbu ex or lbu delete &lt;br /&gt;
| Add filename(s) to exclude list {{Path|/etc/apk/protected_paths.d/lbu.list}}&lt;br /&gt;
|-&lt;br /&gt;
| lbu list-backup&lt;br /&gt;
| lbu lb &lt;br /&gt;
| Show old commits&lt;br /&gt;
|-&lt;br /&gt;
| lbu revert&lt;br /&gt;
|&lt;br /&gt;
|Revert to older commit&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the examples below, you will find some characters with special meaning:&lt;br /&gt;
* &#039;&#039;&#039;|&#039;&#039;&#039; = &#039;&#039;&#039;or&#039;&#039;&#039; &#039;&#039;(&#039;lbu commit|ci&#039; means that you can type ether &#039;lbu commit&#039; or &#039;lbu ci&#039;)&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[ ]&#039;&#039;&#039; = &#039;&#039;&#039;optional&#039;&#039;&#039; &#039;&#039;(In &#039;lbu commit|ci [-nv]&#039; you can skip the &#039;-n&#039;, &#039;-v&#039; or &#039;-nv&#039; part if you don&#039;t want it)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Committing changes ==&lt;br /&gt;
&lt;br /&gt;
When you &amp;quot;commit&amp;quot; or save changes you&#039;ve made to your system, &amp;lt;code&amp;gt;lbu&amp;lt;/code&amp;gt; will generate a file named something like {{Path|&amp;lt;var&amp;gt;myboxname&amp;lt;/var&amp;gt;.apkovl.tar.gz}} &#039;&#039;(&#039;myboxname&#039; will be the same as the hostname)&#039;&#039;.&lt;br /&gt;
The file (which contains your modifications) is called your &amp;quot;apkovl&amp;quot;.&lt;br /&gt;
You will need to save your apkovl on suitable media (floppy, usb, cf, etc.).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Create a backup of config to writeable media.&lt;br /&gt;
&lt;br /&gt;
usage: lbu commit|ci [-nv] [&amp;lt;media&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -d    Remove old apk overlay files.&lt;br /&gt;
  -e    Protect configuration with a password.&lt;br /&gt;
  -n    Don&#039;t commit, just show what would have been commited.&lt;br /&gt;
  -p &amp;lt;password&amp;gt; Give encryption password on the command-line&lt;br /&gt;
  -v    Verbose mode.&lt;br /&gt;
&lt;br /&gt;
The following values for &amp;lt;media&amp;gt; is supported: floppy usb&lt;br /&gt;
If &amp;lt;media&amp;gt; is not specified, the environment variable LBU_BACKUPDIR or&lt;br /&gt;
LBU_MEDIA will be used. If LBU_BACKUPDIR is set, nothing will be mounted.&lt;br /&gt;
&lt;br /&gt;
Password protection will use aes-256-cbc encryption. Other ciphers can be&lt;br /&gt;
used by setting the DEFAULT_CIPHER or ENCRYPTION environment variables.&lt;br /&gt;
For possible ciphers, try: openssl -v&lt;br /&gt;
&lt;br /&gt;
The password used to encrypt the file, can either be specified with the -p&lt;br /&gt;
option or using the PASSWORD environment variable.&lt;br /&gt;
&lt;br /&gt;
The environment variables can also be set in /etc/lbu/lbu.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an .apkovl &amp;quot;package&amp;quot; elsewhere than on the configured media ==&lt;br /&gt;
&lt;br /&gt;
To &amp;quot;commit&amp;quot; changes, but override the destination of the generated apkovl file, use &amp;lt;code&amp;gt;lbu package&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu package|pkg -v [&amp;lt;dirname&amp;gt;|&amp;lt;filename&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -v   Verbose mode.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;dirname&amp;gt; is a directory, a package named &amp;lt;hostname&amp;gt;.apkovl.tar.gz will&lt;br /&gt;
be created in the specified directory.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;filename&amp;gt; is specified, and is not a directory, a package with the&lt;br /&gt;
specified name will be created.&lt;br /&gt;
&lt;br /&gt;
If neither &amp;lt;dirname&amp;gt; nor &amp;lt;filename&amp;gt; is specified, a package named&lt;br /&gt;
&amp;lt;hostname&amp;gt;.apkovl.tar.gz will be created in the current working directory.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To create an apkovl from a client on a remote server, it&#039;s possible to use &amp;lt;code&amp;gt;lbu package&amp;lt;/code&amp;gt; via SSH with {{Path|-}} as the apkovl name on the server:{{Cmd|ssh root@client &amp;quot;lbu package -&amp;quot; &amp;gt; client.apkovl.tar.gz}}&lt;br /&gt;
&lt;br /&gt;
== Checking what will be added to your apkovl ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;lbu status&amp;lt;/code&amp;gt; lists what will be saved the next time you run &amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt;. Its default output is incremental, that is, it shows&lt;br /&gt;
only the files that have changed since the last commit. &amp;lt;br&amp;gt;&lt;br /&gt;
This can be overridden with the &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; flag:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu status|st [-av]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -a    Compare all files, not just since last commit.&lt;br /&gt;
  -v    show include and exclude lists.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option is &amp;lt;code&amp;gt;lbu list&amp;lt;/code&amp;gt;. This works like &amp;lt;code&amp;gt;lbu status -a&amp;lt;/code&amp;gt; but the format of the output is a bit different. (It&#039;s strictly equivalent to &amp;lt;code&amp;gt;lbu package -v /dev/null&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
 usage: lbu list|ls&lt;br /&gt;
&lt;br /&gt;
A third option is &amp;lt;code&amp;gt;lbu diff&amp;lt;/code&amp;gt;. This shows the same incremental changes that &amp;lt;code&amp;gt;lbu status&amp;lt;/code&amp;gt; (without &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt;) does, but in a different format.&lt;br /&gt;
&lt;br /&gt;
  usage: lbu diff&lt;br /&gt;
&lt;br /&gt;
== Include special files/folders to the apkovl ==&lt;br /&gt;
&lt;br /&gt;
Assume you have some files you want to save permanently, but they are not located in {{Path|/etc}}.&amp;lt;BR&amp;gt;&lt;br /&gt;
e.g. {{Path|/root/.ssh/authorized_keys}} (used by &amp;lt;code&amp;gt;sshd&amp;lt;/code&amp;gt; to authenticate ssh-users). Such files/folders can be added to lbu&#039;s &#039;&#039;include&#039;&#039; list with the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu include|inc|add [-rv] &amp;lt;file&amp;gt; ...&lt;br /&gt;
       lbu include|inc|add [-v] -l&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -l	List contents of include list.&lt;br /&gt;
  -r	Remove specified file(s) from include list.&lt;br /&gt;
  -v	Verbose mode.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|This information used to be maintained in {{Path|/etc/lbu/include}}. Now it&#039;s maintained together with the &#039;&#039;exclude&#039;&#039; list in {{Path|/etc/apk/protected_paths.d/lbu.list}}. Either way, the command &amp;lt;code&amp;gt;lbu include&amp;lt;/code&amp;gt; only modifies lbu&#039;s configuration. You will need to run &amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt; to actually create/modify your apkovl.}}&lt;br /&gt;
&lt;br /&gt;
== Exclude specific files/folders from the apkovl ==&lt;br /&gt;
&lt;br /&gt;
Assume you have some files located in {{Path|/etc}} or one of its subfolders you &#039;&#039;do not&#039;&#039; want to save.&lt;br /&gt;
It could be a log file or status file that for some reason isn&#039;t in {{Path|/var/log/}} but in a location that would otherwise be tracked by &amp;lt;code&amp;gt;lbu&amp;lt;/code&amp;gt;.&lt;br /&gt;
Such files/folders can be added to lbu&#039;s &#039;&#039;exclude&#039;&#039; list by manually editing the file or using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu exclude|ex|delete [-rv] &amp;lt;file&amp;gt; ...&lt;br /&gt;
       lbu exclude|ex|delete [-v] -l&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -l	List contents of exclude list.&lt;br /&gt;
  -r	Remove specified file(s) from exclude list.&lt;br /&gt;
  -v	Verbose mode.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note|As stated above, this information is now maintained in {{Path|/etc/apk/protected_paths.d/lbu.list}}. The command &amp;lt;code&amp;gt;lbu exclude&amp;lt;/code&amp;gt; also only modifies lbu&#039;s configuration. You will need to run &amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt; to actually create/modify your apkovl.}}&lt;br /&gt;
&lt;br /&gt;
== Multiple backup versions ==&lt;br /&gt;
&lt;br /&gt;
Lbu can keep multiple backups so you can revert back to older configurations. Set BACKUP_LIMIT in {{Path|/etc/lbu/lbu.conf}} to the number of backups you want to keep. Based on BACKUP_LIMIT, the previously active .apkovl will be renamed before creating the new file.&lt;br /&gt;
&lt;br /&gt;
You can list the currently available backups and revert to an older one with the following commands:{{Cmd|&amp;lt;nowiki&amp;gt;# lbu list-backup [&amp;lt;media&amp;gt;]&lt;br /&gt;
# lbu revert &amp;lt;filename&amp;gt; [&amp;lt;media&amp;gt;]&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Nothing is changed on your running system when &amp;quot;reverting&amp;quot;, it only affects which apkovl is loaded at the next boot.&lt;br /&gt;
&lt;br /&gt;
== Saving and loading ISO image customizations ==&lt;br /&gt;
&amp;lt;!-- This heading is retained here as certain bug reports refer this heading. --&amp;gt;&lt;br /&gt;
ISO boot images can save running states to [[Diskless Mode#Using an internal disk for persistent storage|system partitions]] and automatically loaded when booting the ISO boot image. &lt;br /&gt;
&lt;br /&gt;
== Execute a script as part of a backup ==&lt;br /&gt;
&lt;br /&gt;
Sometimes it&#039;s necessary to run a script before or after a backup.  Scripts in two optional directories enable that:&lt;br /&gt;
&lt;br /&gt;
 /etc/lbu/pre-package.d&lt;br /&gt;
 /etc/lbu/post-package.d&lt;br /&gt;
&lt;br /&gt;
Files in those directories are run using run-script rules (meaning they must have the executable bit set, they are run in alphabetical order, and cannot contain an extension. e.g. {{Path|runme}} works, but {{Path|runme.sh}} does not. Also the shebang line on the first line should be indicated, e.g. #!/bin/sh .)&lt;br /&gt;
&lt;br /&gt;
The scripts in {{Path|pre-package.d}} are run before apkovl is created. Scripts in {{Path|post-package.d}} are run after apkovl is created.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Rather than adding the raw database directories to {{Path|/etc/lbu/include}}, you can do a &amp;quot;database dump&amp;quot;.  e.g. {{Pkg|postgresql}}:&lt;br /&gt;
&lt;br /&gt;
* Create {{Path|/etc/lbu/pre-package.d/sqldump}} with the following contents: &amp;lt;pre&amp;gt;pg_dumpall -U postgres | gzip -c &amp;gt;/root/pgdatabases.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Mark the file executable: &amp;lt;code&amp;gt;chmod +x /etc/lbu/pre-package.d/sqldump&amp;lt;/code&amp;gt;&lt;br /&gt;
* Create {{Path|/etc/lbu/post-package.d/sqldumpdelete}} with the following contents: &amp;lt;pre&amp;gt;rm -f /root/pgdatabases.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Mark the file executable: &amp;lt;code&amp;gt;chmod +x /etc/lbu/post-package.d/sqldumpdelete&amp;lt;/code&amp;gt;&lt;br /&gt;
* Finally, add the database dump file to the list of files to back up: &amp;lt;code&amp;gt;lbu include root/pgdatabases.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when you do a &amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt;, the sql databases are dumped and gzipped to {{Path|/root/pgdatabases.gz}}.&lt;br /&gt;
The temporary file is deleted at the end of the lbu commit.&lt;br /&gt;
&lt;br /&gt;
On a catastrophic restore, the databases are not automatically restored (that&#039;s not lbu&#039;s job), but you will find a complete database dump in the {{Path|/root}} directory, where it can be restored manually.&lt;br /&gt;
&lt;br /&gt;
P.s. These scripts are also launched when starting the commands: diff, list-backup, package, revert, status.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Diskless Mode]]&lt;br /&gt;
* [[Back Up a Flash Memory Installation]]&lt;br /&gt;
* [[Manually editing a existing apkovl]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Booting]]&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[category: Diskless]]&lt;/div&gt;</summary>
		<author><name>Antonomy</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Alpine_local_backup&amp;diff=31533</id>
		<title>Alpine local backup</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Alpine_local_backup&amp;diff=31533"/>
		<updated>2025-11-27T04:11:48Z</updated>

		<summary type="html">&lt;p&gt;Antonomy: fixes broken diskless mode link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Local backup utility ({{ic|lbu}}) is the Alpine Linux tool to manage [[Diskless Mode]] installations. For these installations, {{ic|lbu}} tool must be used to [[#Committing changes|commit the changes]] whenever [[Alpine Package Keeper]] is used.&lt;br /&gt;
&lt;br /&gt;
When Alpine Linux boots in diskless mode, it initially only loads a few required packages from the boot device. However, local adjustments to what-gets-loaded-into-RAM are possible, e.g. installing a package or adjusting the configuration files in {{path|/etc}}. The modifications can be saved with {{ic|lbu}} tool to an overlay file i.e [[Diskless Mode#Apkovl|apkovl]] file  that can be automatically loaded when booting, to restore the saved state.&lt;br /&gt;
&lt;br /&gt;
By default, an {{ic|lbu commit}} only stores modifications below {{Path|/etc}}, with the exception of the {{Path|/etc/init.d/}} directory. If a user was created during the {{ic|setup-alpine}} script, that user&#039;s home directory is also added to the paths that &amp;lt;code&amp;gt;lbu&amp;lt;/code&amp;gt; will backup up. However, [[#Include_special_files.2Ffolders_to_the_apkovl|lbu include]] enables modifying that set of included files, and can be used to specify additional files or folders.&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;lbu&amp;lt;/code&amp;gt; tool has several subcommands to manage the .apkovl:&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| lbu commit &lt;br /&gt;
| lbu ci &lt;br /&gt;
| Create a backup of config to writeable media&lt;br /&gt;
|-&lt;br /&gt;
| lbu package &lt;br /&gt;
| lbu pkg&lt;br /&gt;
| Create backup package&lt;br /&gt;
|-&lt;br /&gt;
| lbu status &lt;br /&gt;
| lbu st &lt;br /&gt;
| Check what files have been changed since last commit&lt;br /&gt;
|-&lt;br /&gt;
| lbu list&lt;br /&gt;
| lbu ls&lt;br /&gt;
| Lists files that would go to tar package. Same as: {{Codeline|lbu package -v /dev/null}}&lt;br /&gt;
|-&lt;br /&gt;
| lbu diff&lt;br /&gt;
|&lt;br /&gt;
| Run a diff against last commit&lt;br /&gt;
|-&lt;br /&gt;
| lbu include&lt;br /&gt;
| lbu inc or lbu add&lt;br /&gt;
| Add filename(s) to include list{{Path|/etc/apk/protected_paths.d/lbu.list}}&lt;br /&gt;
|-&lt;br /&gt;
| lbu exclude&lt;br /&gt;
| lbu ex or lbu delete &lt;br /&gt;
| Add filename(s) to exclude list {{Path|/etc/apk/protected_paths.d/lbu.list}}&lt;br /&gt;
|-&lt;br /&gt;
| lbu list-backup&lt;br /&gt;
| lbu lb &lt;br /&gt;
| Show old commits&lt;br /&gt;
|-&lt;br /&gt;
| lbu revert&lt;br /&gt;
|&lt;br /&gt;
|Revert to older commit&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the examples below, you will find some characters with special meaning:&lt;br /&gt;
* &#039;&#039;&#039;|&#039;&#039;&#039; = &#039;&#039;&#039;or&#039;&#039;&#039; &#039;&#039;(&#039;lbu commit|ci&#039; means that you can type ether &#039;lbu commit&#039; or &#039;lbu ci&#039;)&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[ ]&#039;&#039;&#039; = &#039;&#039;&#039;optional&#039;&#039;&#039; &#039;&#039;(In &#039;lbu commit|ci [-nv]&#039; you can skip the &#039;-n&#039;, &#039;-v&#039; or &#039;-nv&#039; part if you don&#039;t want it)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Committing changes ==&lt;br /&gt;
&lt;br /&gt;
When you &amp;quot;commit&amp;quot; or save changes you&#039;ve made to your system, &amp;lt;code&amp;gt;lbu&amp;lt;/code&amp;gt; will generate a file named something like {{Path|&amp;lt;var&amp;gt;myboxname&amp;lt;/var&amp;gt;.apkovl.tar.gz}} &#039;&#039;(&#039;myboxname&#039; will be the same as the hostname)&#039;&#039;.&lt;br /&gt;
The file (which contains your modifications) is called your &amp;quot;apkovl&amp;quot;.&lt;br /&gt;
You will need to save your apkovl on suitable media (floppy, usb, cf, etc.).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Create a backup of config to writeable media.&lt;br /&gt;
&lt;br /&gt;
usage: lbu commit|ci [-nv] [&amp;lt;media&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -d    Remove old apk overlay files.&lt;br /&gt;
  -e    Protect configuration with a password.&lt;br /&gt;
  -n    Don&#039;t commit, just show what would have been commited.&lt;br /&gt;
  -p &amp;lt;password&amp;gt; Give encryption password on the command-line&lt;br /&gt;
  -v    Verbose mode.&lt;br /&gt;
&lt;br /&gt;
The following values for &amp;lt;media&amp;gt; is supported: floppy usb&lt;br /&gt;
If &amp;lt;media&amp;gt; is not specified, the environment variable LBU_BACKUPDIR or&lt;br /&gt;
LBU_MEDIA will be used. If LBU_BACKUPDIR is set, nothing will be mounted.&lt;br /&gt;
&lt;br /&gt;
Password protection will use aes-256-cbc encryption. Other ciphers can be&lt;br /&gt;
used by setting the DEFAULT_CIPHER or ENCRYPTION environment variables.&lt;br /&gt;
For possible ciphers, try: openssl -v&lt;br /&gt;
&lt;br /&gt;
The password used to encrypt the file, can either be specified with the -p&lt;br /&gt;
option or using the PASSWORD environment variable.&lt;br /&gt;
&lt;br /&gt;
The environment variables can also be set in /etc/lbu/lbu.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Creating an .apkovl &amp;quot;package&amp;quot; elsewhere than on the configured media ==&lt;br /&gt;
&lt;br /&gt;
To &amp;quot;commit&amp;quot; changes, but override the destination of the generated apkovl file, use &amp;lt;code&amp;gt;lbu package&amp;lt;/code&amp;gt; instead of &amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu package|pkg -v [&amp;lt;dirname&amp;gt;|&amp;lt;filename&amp;gt;]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -v   Verbose mode.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;dirname&amp;gt; is a directory, a package named &amp;lt;hostname&amp;gt;.apkovl.tar.gz will&lt;br /&gt;
be created in the specified directory.&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;filename&amp;gt; is specified, and is not a directory, a package with the&lt;br /&gt;
specified name will be created.&lt;br /&gt;
&lt;br /&gt;
If neither &amp;lt;dirname&amp;gt; nor &amp;lt;filename&amp;gt; is specified, a package named&lt;br /&gt;
&amp;lt;hostname&amp;gt;.apkovl.tar.gz will be created in the current working directory.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To create an apkovl from a client on a remote server, it&#039;s possible to use &amp;lt;code&amp;gt;lbu package&amp;lt;/code&amp;gt; via SSH with {{Path|-}} as the apkovl name on the server:{{Cmd|ssh root@client &amp;quot;lbu package -&amp;quot; &amp;gt; client.apkovl.tar.gz}}&lt;br /&gt;
&lt;br /&gt;
== Checking what will be added to your apkovl ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;lbu status&amp;lt;/code&amp;gt; lists what will be saved the next time you run &amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt;. Its default output is incremental, that is, it shows&lt;br /&gt;
only the files that have changed since the last commit. &amp;lt;br&amp;gt;&lt;br /&gt;
This can be overridden with the &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt; flag:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu status|st [-av]&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -a    Compare all files, not just since last commit.&lt;br /&gt;
  -v    show include and exclude lists.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another option is &amp;lt;code&amp;gt;lbu list&amp;lt;/code&amp;gt;. This works like &amp;lt;code&amp;gt;lbu status -a&amp;lt;/code&amp;gt; but the format of the output is a bit different. (It&#039;s strictly equivalent to &amp;lt;code&amp;gt;lbu package -v /dev/null&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
 usage: lbu list|ls&lt;br /&gt;
&lt;br /&gt;
A third option is &amp;lt;code&amp;gt;lbu diff&amp;lt;/code&amp;gt;. This shows the same incremental changes that &amp;lt;code&amp;gt;lbu status&amp;lt;/code&amp;gt; (without &amp;lt;code&amp;gt;-a&amp;lt;/code&amp;gt;) does, but in a different format.&lt;br /&gt;
&lt;br /&gt;
  usage: lbu diff&lt;br /&gt;
&lt;br /&gt;
== Include special files/folders to the apkovl ==&lt;br /&gt;
&lt;br /&gt;
Assume you have some files you want to save permanently, but they are not located in {{Path|/etc}}.&amp;lt;BR&amp;gt;&lt;br /&gt;
e.g. {{Path|/root/.ssh/authorized_keys}} (used by &amp;lt;code&amp;gt;sshd&amp;lt;/code&amp;gt; to authenticate ssh-users). Such files/folders can be added to lbu&#039;s &#039;&#039;include&#039;&#039; list with the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu include|inc|add [-rv] &amp;lt;file&amp;gt; ...&lt;br /&gt;
       lbu include|inc|add [-v] -l&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -l	List contents of include list.&lt;br /&gt;
  -r	Remove specified file(s) from include list.&lt;br /&gt;
  -v	Verbose mode.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|This information used to be maintained in {{Path|/etc/lbu/include}}. Now it&#039;s maintained together with the &#039;&#039;exclude&#039;&#039; list in {{Path|/etc/apk/protected_paths.d/lbu.list}}. Either way, the command &amp;lt;code&amp;gt;lbu include&amp;lt;/code&amp;gt; only modifies lbu&#039;s configuration. You will need to run &amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt; to actually create/modify your apkovl.}}&lt;br /&gt;
&lt;br /&gt;
== Exclude specific files/folders from the apkovl ==&lt;br /&gt;
&lt;br /&gt;
Assume you have some files located in {{Path|/etc}} or one of its subfolders you &#039;&#039;do not&#039;&#039; want to save.&lt;br /&gt;
It could be a log file or status file that for some reason isn&#039;t in {{Path|/var/log/}} but in a location that would otherwise be tracked by &amp;lt;code&amp;gt;lbu&amp;lt;/code&amp;gt;.&lt;br /&gt;
Such files/folders can be added to lbu&#039;s &#039;&#039;exclude&#039;&#039; list by manually editing the file or using the following command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
usage: lbu exclude|ex|delete [-rv] &amp;lt;file&amp;gt; ...&lt;br /&gt;
       lbu exclude|ex|delete [-v] -l&lt;br /&gt;
&lt;br /&gt;
Options:&lt;br /&gt;
  -l	List contents of exclude list.&lt;br /&gt;
  -r	Remove specified file(s) from exclude list.&lt;br /&gt;
  -v	Verbose mode.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note|As stated above, this information is now maintained in {{Path|/etc/apk/protected_paths.d/lbu.list}}. The command &amp;lt;code&amp;gt;lbu exclude&amp;lt;/code&amp;gt; also only modifies lbu&#039;s configuration. You will need to run &amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt; to actually create/modify your apkovl.}}&lt;br /&gt;
&lt;br /&gt;
== Multiple backup versions ==&lt;br /&gt;
&lt;br /&gt;
Lbu can keep multiple backups so you can revert back to older configurations. Set BACKUP_LIMIT in {{Path|/etc/lbu/lbu.conf}} to the number of backups you want to keep. Based on BACKUP_LIMIT, the previously active .apkovl will be renamed before creating the new file.&lt;br /&gt;
&lt;br /&gt;
You can list the currently available backups and revert to an older one with the following commands:{{Cmd|&amp;lt;nowiki&amp;gt;# lbu list-backup [&amp;lt;media&amp;gt;]&lt;br /&gt;
# lbu revert &amp;lt;filename&amp;gt; [&amp;lt;media&amp;gt;]&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
Nothing is changed on your running system when &amp;quot;reverting&amp;quot;, it only affects which apkovl is loaded at the next boot.&lt;br /&gt;
&lt;br /&gt;
== Saving and loading ISO image customizations ==&lt;br /&gt;
&amp;lt;!-- This heading is retained here as certain bug reports refer this heading. --&amp;gt;&lt;br /&gt;
ISO boot images can save running states to [[Diskless Mode#Using an internal disk for persistent storage|system partitions]] and automatically loaded when booting the ISO boot image. &lt;br /&gt;
&lt;br /&gt;
== Execute a script as part of a backup ==&lt;br /&gt;
&lt;br /&gt;
Sometimes it&#039;s necessary to run a script before or after a backup.  Scripts in two optional directories enable that:&lt;br /&gt;
&lt;br /&gt;
 /etc/lbu/pre-package.d&lt;br /&gt;
 /etc/lbu/post-package.d&lt;br /&gt;
&lt;br /&gt;
Files in those directories are run using run-script rules (meaning they must have the executable bit set, they are run in alphabetical order, and cannot contain an extension. e.g. {{Path|runme}} works, but {{Path|runme.sh}} does not. Also the shebang line on the first line should be indicated, e.g. #!/bin/sh .)&lt;br /&gt;
&lt;br /&gt;
The scripts in {{Path|pre-package.d}} are run before apkovl is created. Scripts in {{Path|post-package.d}} are run after apkovl is created.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Rather than adding the raw database directories to {{Path|/etc/lbu/include}}, you can do a &amp;quot;database dump&amp;quot;.  e.g. {{Pkg|postgresql}}:&lt;br /&gt;
&lt;br /&gt;
* Create {{Path|/etc/lbu/pre-package.d/sqldump}} with the following contents: &amp;lt;pre&amp;gt;pg_dumpall -U postgres | gzip -c &amp;gt;/root/pgdatabases.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Mark the file executable: &amp;lt;code&amp;gt;chmod +x /etc/lbu/pre-package.d/sqldump&amp;lt;/code&amp;gt;&lt;br /&gt;
* Create {{Path|/etc/lbu/post-package.d/sqldumpdelete}} with the following contents: &amp;lt;pre&amp;gt;rm -f /root/pgdatabases.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Mark the file executable: &amp;lt;code&amp;gt;chmod +x /etc/lbu/post-package.d/sqldumpdelete&amp;lt;/code&amp;gt;&lt;br /&gt;
* Finally, add the database dump file to the list of files to back up: &amp;lt;code&amp;gt;lbu include root/pgdatabases.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when you do a &amp;lt;code&amp;gt;lbu commit&amp;lt;/code&amp;gt;, the sql databases are dumped and gzipped to {{Path|/root/pgdatabases.gz}}.&lt;br /&gt;
The temporary file is deleted at the end of the lbu commit.&lt;br /&gt;
&lt;br /&gt;
On a catastrophic restore, the databases are not automatically restored (that&#039;s not lbu&#039;s job), but you will find a complete database dump in the {{Path|/root}} directory, where it can be restored manually.&lt;br /&gt;
&lt;br /&gt;
P.s. These scripts are also launched when starting the commands: diff, list-backup, package, revert, status.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Diskless Mode]]&lt;br /&gt;
* [[Back Up a Flash Memory Installation]]&lt;br /&gt;
* [[Manually editing a existing apkovl]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[Category:Booting]]&lt;br /&gt;
[[Category:Package Manager]]&lt;br /&gt;
[[category: Diskless]]&lt;/div&gt;</summary>
		<author><name>Antonomy</name></author>
	</entry>
</feed>