# Het handboek van &kbackup;

## Inleiding

&kbackup; is a program that lets you back up any folders or files, whereby it uses an easy to use folder tree to select the things to back up. It lets you save your settings in so-called profile files, where a profile is a simple text file containing definitions for folders and files to be included or excluded from the backup process. Also, it lets you define where the backup shall be saved to. The target can be either a local folder (⪚ a locally mounted device like a ZIP drive, USB stick, &etc;) but it can also be any remote &URL; (⪚ smb://remote/some_path) to back up your data to some central server, &etc;

The program can also run an automated backup without using a graphical user interface. One can simply create a profile and use these settings to tell &kbackup; what to do when running in non-interactive mode, ⪚ by starting it from a cron job.

Het programma is ontworpen om eenvoudig in gebruik te zijn zodat het gebruikt kan worden door de eenvoudige computergebruiker.

The storage format is the well known TAR format, whereby the data can still be stored in compressed format (bzip2 or gzip).

The current implementation features only the backup step. To restore data back into your system, you currently have to use, ⪚, &dolphin; to open the TAR backup files and drag/drop the files back to your file system. This is also an advantage of the usage of the well known and well supported TAR file format.

Als de bestanden gecomprimeerd zijn kunt u alle bestanden recursief uitpakken uit de huidige map met het volgende commando:

    find . -name \*bz2 -print0 | xargs -0 bunzip2

U kunt als alternatief ook &ark; gebruiken om een volledige backup uit te pakken of gewoon een paar bestanden uit een backup.

## &kbackup; gebruiken

All you need to do is to select which folders you want to store. This is done by selecting all the folders in the tree view on the left side of the main window.

If you select a folder, &kbackup; will automatically store all files and subfolders below it. If you want to exclude parts of a selected folder, simply deselect that files/folders inside the still selected folder.

In general, this means: A selected folder will store everything in it and below it, except the deselected parts in it. This also means, whenever you reuse a profile (see below) later on and new files have been added to a folder already selected for backup, all the new files will also be stored.

Hier is een schermafdruk van &kbackup; Schermafbeelding van het hoofdvenster

### Using profiles

To keep a selection for later use, simply save it into a &kbackup; profile file. Use the File menu and select Save Profile.

To reload a selection into &kbackup;, use the File Load Profile... menu item.

&kbackup; saves in a profile the selections for all included folders/files, excluded folders/files, the target folder/&URL;, defined archive prefix, the defined maximum slice file size, &etc;

If you want to ease the usage of backing up every day the same set of files, simply store your settings into a &kbackup; profile (a `.kbp` file) and pass that file on the command line.

⪚:

    kbackup myData.kbp

Hint: you can also create a shortcut on your desktop to a `.kbp` file as the file type is registered to start &kbackup; on double click.

### Archive slices

As a medium has normally limited capacity (⪚ 100MB ZIP disc), &kbackup; will create several archive slices.

Each archive slice will get its own name, which looks like this:

backup_2006.08.26-13.04.44_1.tar

The name contains the creation date and time (which will be the same for all slices of one backup) and a trailing slice sequence number (_1 in this example).

In the menu File Profile Settings..., you can define a different archive prefix than the default backup.

In the Profile Settings dialog, you can also define a maximum archive slice size, which limits the slice size even if there would be more space left on the target device. This helps to create archive slices which can then be later burned on a &CD;/&DVD;, &etc; If you explicitly limit the size of an archive slice, the available size will be marked with (*) in the main window.

But even if you define a slice to be of unlimited size, there are other constraints which limit the size of a slice:

- Beperkt door de doelmap (bij direct opslaan in een lokale map)

- beperkt door de map `/tmp` toen we een tmp-bestand voor latere upload naar een externe &URL;

In the Profile Settings, you can also define a maximum number of backups being kept in the target folder, and therefore automatically deleting all older backups there. ⪚ if you set it to 3, &kbackup; will keep the last 3 backups and delete all older ones.

### Incrementele reservekopie

With an incremental backup not all files will be saved every time the backup runs, but only the files which have changed since the last backup. This has the great advantage that the incremental backup will usually include much fewer files than a full backup and therefore will be finished in a much shorter time.

This works as follows: In the profile, you define an interval (in days) for the full backup. ⪚ when you define 5 days, then &kbackup; will do a full backup of all files every 5 days. Whenever you start &kbackup; before the interval expires with this profile - regardless how often you run a backup - only the files which have changed since the last backup will be saved. &kbackup; stores the time stamp of the last backup into the profile and knows therefore what to do when running the next time.

Besatnden van het archiefgedeelte gemaakt tijdens een incrementele backup zal de tekst _inc bevatten, ⪚:

backup_2010.06.14-18.50.26_1_inc.tar

Full backup slice files will not include _inc in the name, ⪚:

backup_2010.06.13-20.58.14_1.tar

When one wants to restore files from an incremental backup, it's important to look for the most recent version of a file to be restored in all _inc files and finally also the last full backup slice file. This exactly is also the disadvantage of the incremental backup (but no advantage without disadvantage ;-) )

If you want to do a full backup earlier than the defined incremental cycle time defined in a profile, you can do so by checking the Force Full Backup option in the user interface. When &kbackup; is started via the command line, this can be achieved by using the option `--forceFull`

Een afgedwongen volledige reservekopie zal de backupcyclus herstarten, &ie; &kbackup; telt de dagen naar de volgende volledige reservekopie vanaf de tijd van de laatste volledige reservekopie.

### Compressie van het archief

&kbackup; will compress the files stored if you activate this in the profile settings. Depending on the availability on your system it chooses `bzip2` or `gzip` compression. &kbackup; will compress every single file and store all files with an added file extension (`.bzip2` or `.gz`) into the then not-compressed `.tar` archive.

When you have selected to create the backup on some local filesystem (⪚ your extra disc, ZIP drive, &etc;) - which means you did not enter a remote target &URL; - &kbackup; might split the whole backup into several archive slices due to media capacity limitations.

⪚:

backup_2006.08.26-13.04.44_1.tar

backup_2006.08.26-13.04.44_2.tar

### Reservekopie maken automatiseren

If you want to automate the process of the backup, &kbackup; offers different command line options to help with this:

- `--auto`

  When you run &kbackup; with this option and a given `.kbp` profile, it will start, load the given profile, run the backup and terminate when done. All this is done with a visible &kbackup; user interface.

- `--autobg`

  When you run &kbackup; with this option and a given `.kbp` profile, it will run the same process as with `--auto` but without showing any graphical user interface. Therefore the suffix bg which stands for background - everything is done in the background so this is the right option to be used when you do your backups, ⪚, started by a cron job.

  When using `--autobg` the output from &kbackup; - showing the progress of the backup - is written to stderr. By default, the output includes just a few important messages and a summary at the end. If you pass `--verbose` in addition, then you will also see each file name currently being backed up.

## Overzicht van de opdrachten

### Het hoofdvenster van &kbackup;

#### Het menu Bestand

Bestand Recent openen

- Shows a submenu with the recently used profiles for easy selection.

Bestand Nieuw profiel

- Clears the selection and the target input field, to be able to define a new profile.

Bestand Profiel laden...

- Laadt een profiel.

Bestand Profiel opslaan

- Slaat alle instellingen op in het nu geladen profiel.

Bestand Profiel opslaan als...

- Slaat alle instellingen op in een profiel met een neiuwe naam.

Bestand Profielinstellingen...

- In the settings, you can define whether the archive-slice files start with the default name backup or with an alternative name. Also you can limit the archive slice size. See chapter Archive Slices. These settings are also stored into the profile.

&Ctrl;Q Bestand Afsluiten

- Sluit &kbackup; af.

#### Het menu Instellingen

Instellingen In systeemvak vastzetten

- When this option is activated, an icon is shown in the system tray, which reflects the current status of a backup operation. An animation is shown when a backup is in progress, else you see a static icon. If this option is selected, the closing of the main window will not terminate &kbackup;. The application must be explicitly terminated by selecting the Quit action. Via the context menu of the &kbackup; system tray icon you can start and cancel a backup operation - which is the same as you can do in the main window. The tooltip on this icon also gives progress information (Number of saved files, size of the backup and the last saved file).

Instellingen Alle meldingen inschakelen

- Activating this entry clears all internally stored Do not ask again flags for the dialogs shown in &kbackup;.

Settings Show Hidden Files

- Enable or disable the display of hidden files (preceded by a dot character) in the tree view. Use this option if you want to exclude some hidden files from the backup. If you want to exclude all hidden files, use a filename filter in the profile settings.

#### Het menu Help

&kbackup; has the common &kde; Help menu item, for more information read the section about the Help Menu of the &kde; Fundamentals.

## Developer's Guide to &kbackup;

&kbackup; can be extended by using a shell script (or any other executable) which will be started at three different points during the backup process. The idea behind it is to allow to mount, unmount, eject media in a system specific way, or do other things with the produced archive files.

The script to execute must be given with the `--script` command line option.

Hier is een voorbeeldscript:

### sliceScript.sh

    #!/bin/sh

    mode=$1
    archive=$2
    target=$3
    mountPoint=$4

    case "$mode" in
     "slice_init" )
        if [ "$mountPoint" != "" ]
        then
          mount /media/zip
          rm -f /media/zip/backup_2*.tar*
        fi
     ;;

     "slice_closed" )
     ;;

     "slice_finished" )
        if [ "$mountPoint" != "" ]
        then
          umount /media/zip
          eject /media/zip
        fi
     ;;
    esac

Het script wordt altijd geactiveerd met vier argumenten op de opdrachtregel:

- activeringsmodus

- archief (gedeelte) bestandsnaam

- doelmap/&URL;

- aankoppelpunt van de doelmap als het een lokale map is, anders een lege tekenreeks

Er zijn drie mogelijke modi van uitvoeren:

- slice_init

  aangeroepen voordat een nieuw archiefgedeelte wordt aangemaakt op schijf

- slice_closed

  aangeroepen nadat een archiefgedeelte met is aangemaakt, maar voordat het in de doelmap is geplaatst

  Dit kan gebruikt worden als u het archiefgedeelte wilt kopiëren naar een extra plaats, ⪚ het archief wordt verzonden naar de hoofdserver (via een doel-&URL;), maar u wilt de laatste backup ook op de lokale schijf houden.

- slice_finished

  aangeroepen nadat een archiefgedeelte met succes is overgebracht in de doelmap

## Dankbetuigingen en licentie

&kbackup;

Programma copyright © 2006 - 2009 Martin Koller kollix@aon.at

Documentatie copyright © 2006 - 2009 Martin Koller

&meld.fouten;&vertaling.freek; &underFDL; &underGPL;
&documentation.index;