Alpine local backup: Difference between revisions
(→Alpine local backups: You don't need to use lbu if you installed Alpine on HDD) |
m (Formatting / spelling / grammar) |
||
Line 1: | Line 1: | ||
= Alpine local backups = | = Alpine local backups = | ||
Alpine itself only | Alpine itself only loads a few required packages when you boot a clean Alpine Linux.<BR> | ||
But you probably want to do some personal adjustments (e.g [[Alpine_package_management|installing a package]] or doing some configuration).<BR> | But you probably want to do some personal adjustments (e.g [[Alpine_package_management|installing a package]] or doing some configuration).<BR> | ||
Because Alpine | Because Alpine runs on RAM (normally), and everything in RAM will get lost next time the box is rebooted or shut down, you will need to permanently save your modifications and adjustments to Alpine. This is where 'lbu' comes in handy! | ||
{{Note | If you installed Alpine on HDD you don't need to use 'lbu'. All your modifications would be permanently stored on your HDD.}} | |||
First thing you need to know is this: '''As default 'lbu' only cares about modifications in ''/etc/'' and it's subfolders, with the exception of /etc/init.d/!''' <BR> | First thing you need to know is this: '''As default 'lbu' only cares about modifications in ''/etc/'' and it's subfolders, with the exception of /etc/init.d/!''' <BR> | ||
Line 17: | Line 17: | ||
* lbu_update ''(Same as 'lbu update')'' | * lbu_update ''(Same as 'lbu update')'' | ||
In the below examples you will | In the below examples you will find some characters with special meaning | ||
* '''|''' = '''or''' ''('lbu commit|ci' means that you can type ether 'lbu commit' or 'lbu ci')'' | * '''|''' = '''or''' ''('lbu commit|ci' means that you can type ether 'lbu commit' or 'lbu ci')'' | ||
* '''[ ]''' = '''optional''' ''(In 'lbu commit|ci [-nv]' you can just skip the '-n', '-v' or '-nv' part if you don't want it)'' | * '''[ ]''' = '''optional''' ''(In 'lbu commit|ci [-nv]' you can just skip the '-n', '-v' or '-nv' part if you don't want it)'' | ||
Line 31: | Line 31: | ||
-d Remove old apk overlay files. | -d Remove old apk overlay files. | ||
-e Protect configuration with a password. | -e Protect configuration with a password. | ||
-n Don't commit, just show what would have been | -n Don't commit, just show what would have been committed. | ||
-p <password> Give encryption password on the command-line | -p <password> Give encryption password on the command-line | ||
-v Verbose mode. | -v Verbose mode. | ||
Line 45: | Line 45: | ||
option or using the PASSWORD environment variable. | option or using the PASSWORD environment variable. | ||
The environment | The environment variables can also be set in /etc/lbu/lbu.conf | ||
</pre> | </pre> | ||
Line 61: | Line 61: | ||
-v Verbose mode. | -v Verbose mode. | ||
</pre> | </pre> | ||
'''''Note:''' This command only modifies some lbu-related | '''''Note:''' This command only modifies some lbu-related config files. You will need to run 'lbu commit' to actually create/modify your apkovl.'' | ||
== Exclude specific files/folders from the apkovl == | == Exclude specific files/folders from the apkovl == | ||
Assume that you have some files located in ''/etc/'' or one of it's subfolders that you '''do not''' want to permanently save.<BR> | Assume that you have some files located in ''/etc/'' or one of it's subfolders that you '''do not''' want to permanently save.<BR> | ||
It could be some | It could be some log file or status file that for some reason is elsewhere than in ''/var/log''.<BR> | ||
Such files/folders can be added to the ''/etc/lbu/exclude'' list by manually editing the file or using the following command: | Such files/folders can be added to the ''/etc/lbu/exclude'' list by manually editing the file or using the following command: | ||
<pre> | <pre> | ||
Line 76: | Line 76: | ||
-v Verbose mode. | -v Verbose mode. | ||
</pre> | </pre> | ||
'''''Note:''' This command only modifies some lbu-related | '''''Note:''' This command only modifies some lbu-related config files. You will need to run 'lbu commit' to actually create/modify your apkovl.'' | ||
== Check what will be added to your apkovl == | == Check what will be added to your apkovl == | ||
Line 93: | Line 93: | ||
be created in the specified directory. | be created in the specified directory. | ||
If <filename> is specified, and is not a | If <filename> is specified, and is not a directory, a package with the | ||
specified name | specified name will be created. | ||
If <dirname> nor <filename> is not specified, a package named | If <dirname> nor <filename> is not specified, a package named |
Revision as of 09:07, 29 November 2010
Alpine local backups
Alpine itself only loads a few required packages when you boot a clean Alpine Linux.
But you probably want to do some personal adjustments (e.g installing a package or doing some configuration).
Because Alpine runs on RAM (normally), and everything in RAM will get lost next time the box is rebooted or shut down, you will need to permanently save your modifications and adjustments to Alpine. This is where 'lbu' comes in handy!
First thing you need to know is this: As default 'lbu' only cares about modifications in /etc/ and it's subfolders, with the exception of /etc/init.d/!
Please have a look at 'lbu include' to save files/folders located elsewhere than in /etc/.
Alpine has the following tools for permanently storing your modifications:
- lbu
- lbu_commit (Same as 'lbu commit')
- lbu_exclude (Same as 'lbu exclude')
- lbu_include (Same as 'lbu include')
- lbu_status (Same as 'lbu status')
- lbu_update (Same as 'lbu update')
In the below examples you will find some characters with special meaning
- | = or ('lbu commit|ci' means that you can type ether 'lbu commit' or 'lbu ci')
- [ ] = optional (In 'lbu commit|ci [-nv]' you can just skip the '-n', '-v' or '-nv' part if you don't want it)
Saving your changes
When you save your changes you will get a file that is named like 'myboxname.apkovl.tar.gz' ('myboxname' will be the same as the hostname).
This file (that contains your modifications) is called 'apkovl'.
You will need to save your 'apkovl' on some suitable media (floppy, usb, cf, other).
usage: lbu commit|ci [-nv] [<media>] Options: -d Remove old apk overlay files. -e Protect configuration with a password. -n Don't commit, just show what would have been committed. -p <password> Give encryption password on the command-line -v Verbose mode. The following values for <media> is supported: floppy usb If <media> is not specified, the environment variable LBU_MEDIA will be used. Password protection will use aes-256-cbc encryption. Other ciphers can be used by setting the DEFAULT_CIPHER or ENCRYPTION environment variables. For possible ciphers, try: openssl -v The password used to encrypt the file, can either be specified with the -p option or using the PASSWORD environment variable. The environment variables can also be set in /etc/lbu/lbu.conf
Include special files/folders to the apkovl
Assume that you have some files that you want to permanently save, but they are located somewhere else than in /etc/.
It could be /root/.ssh/authorized_keys (used by 'sshd' to authenticate ssh-users).
Such files/folders can be added to the /etc/lbu/include list by manually editing the file or using the following command:
usage: lbu include|inc|add [-rv] <file> ... lbu include|inc|add [-v] -l Options: -l List contents of include list. -r Remove specified file(s) from include list instead of adding. -v Verbose mode.
Note: This command only modifies some lbu-related config files. You will need to run 'lbu commit' to actually create/modify your apkovl.
Exclude specific files/folders from the apkovl
Assume that you have some files located in /etc/ or one of it's subfolders that you do not want to permanently save.
It could be some log file or status file that for some reason is elsewhere than in /var/log.
Such files/folders can be added to the /etc/lbu/exclude list by manually editing the file or using the following command:
usage: lbu exclude|ex|delete [-rv] <file> ... lbu exclude|ex|delete [-v] -l Options: -l List contents of exclude list. -r Remove specified file(s) from exclude list instead of adding. -v Verbose mode.
Note: This command only modifies some lbu-related config files. You will need to run 'lbu commit' to actually create/modify your apkovl.
Check what will be added to your apkovl
Sometimes it would be handy to know what files will be permanently saved next time you run 'lbu commit'. Here you have your help:
usage: lbu list|ls
Create a apkovl elsewhere than on some specific media
usage: lbu package|pkg -v [<dirname>|<filename>] Options: -v Verbose mode. If <dirname> is a directory, a package named <hostname>.apkovl.tar.gz will be created in the specified directory. If <filename> is specified, and is not a directory, a package with the specified name will be created. If <dirname> nor <filename> is not specified, a package named <hostname>.apkovl.tar.gz will be created in current work directory.
Check what files have been changed since last commit
usage: lbu status|st [-M <MASK>] [-av] Options: -M Use a different mask for comparing. (see sfic -h) -a Compare all files, not just since last commit. -v Also show include and exclude lists.
Multiple Backups
Lbu can now keep backups so you can revert to older, good known config. Set BACKUP_LIMIT in /etc/lbu/lbu.conf to the number of backups you want to keep.
You can list the current backups with:
lbu list-backup [<media>]
and you can revert to an older with:
lbu revert <filename> [<media>]
Note that when you revert, the current apkovl on media will be backed up.