Examples

Let’s make a backup of configuration files of all users except the user “foo”. Let’s assume that our system has unix-like style of home directories (directory “/home” contains directories of all users; configuration files begins with dot). Name of this backup will be “user-configs”.

Configuring the Archive Example

First, we need to create the file “user-configs.aa” under the “~/.config/aa/archive_specs/” directory - this is the archive specification file. The file doesn’t need to have the same name as the backup. If it does however, the option name can be left out (in this example we specified it anyway, even it is not needed). Variables include-files and exclude-files contains list of files and directories that we want to be included or excluded respectively. If we would not want to exclude any file then the corresponding variable would be specified as exclude-files =.

Content of the “user-configs.aa” file:

# ------ begin of user-configs.aa ------
# AutoArchive's archive specification file for users configuration files
[Content]
name = user-configs
path = /home
include-files = */.*
exclude-files = foo

[Archive]
dest-dir = /mnt/backup
# ------ end of user-configs.aa ------

Backup Creation Example

Once we configured the archive we can create the backup easily with command:

aa user-configs

and in the “/mnt/backup” directory the file “user-configs.tar.gz” will be created.

Given the “user-configs.aa” example file above, the command:

aa -i user-configs

will create level 0 incremental backup – “user-configs.tar.gz” which is essentially the same as a non-incremental backup. Another execution of the same command will create level 1 backup named “user-configs.1.tar.gz” which contains only a differences from level 0. Each subsequent call will create a next level which will contain only a differences from previous.

In order to restart to level 0 again, thus create a fresh full backup, the following command can be used:

aa -i -l 0 user-configs

Note that you should remove all previously created “user-configs” backups with level higher than 0 because they are no longer valid in regards to the newly created level 0 backup.

Listing Archives Example

Our “user-configs” archive can be listed by following command:

aa --list

Which results to the following output:

user-configs /home                    /mnt/backups               [0]/[1]/[10]

If we pass --verbose option then it shows:

Name: user-configs
Root: /home
Archiver type: targz
Destination directory: /mnt/backups
Current backup level/next/max.: [0]/[1]/[10]
Target backup level for non-full restart: [1]
Upcoming restart reason: [No restart scheduled for the next backup.]
Restart count/max.: [-]/[-]
Days since last restart/max.: [-]/[-]
Days since last full restart/max.: [-]/[-]

The archive Name is “user-configs” as configured with the name variable in the Configuring the Archive Example section. Root corresponds to the value configured with the path variable. Archiver type is “targz” which is the default. Destination directory “/mnt/backup” is configured with dest-dir variable. Current backup level/next/max. shows [0]/[1]/[10] because in the section Backup Creation Example we have created an incremental backup of level 0, so current level is 0. Next level is 1 (restarting is not enabled). Both the current and the next levels are enclosed in square brackets because incremental archiving is not enabled (it was enabled only temporarily with the -i option). Finally, the maximal backup level is 10 as it is the default. It is also shown in square brackets because restarting is not enabled; this also applies for all following values. Since no max-restart-level-size is specified the Target backup level for non-full restart is and always be 1. Obviously, no restart is scheduled as the Upcoming restart reason value is showing. Since no restart ever occurred and no value is specified for the rest of restarting options the values Restart count/max., Days since last restart/max. and Days since last full restart/max. shows only dashes.

Cleaning Orphaned Information Example

If we remove the “user-configs.aa” archive specification file then the --list will still be showing the archive with its name enclosed in square brackets (it becomes the orphaned archive):

[user-configs] ?                    .                            [0]/[?]/[10]

This is because some information is still stored in the AutoArchive’s configuration directory. It is the snapshot file created by tar when incremental backup was created. There may be more information left behind if restarting would be enabled. All of this orphaned information can be deleted with the --purge command:

aa --purge user-configs

or:

aa --purge --all

which would remove all orphaned archives.