@@ -13,19 +13,19 @@ In the IML Backup exist the following hooks
...
@@ -13,19 +13,19 @@ In the IML Backup exist the following hooks
| Hook | where | description
| Hook | where | description
|--- |--- |---
|--- |--- |---
| 10-before-backup | backup.sh | at the beginning of the backup
| 100-before-backup | backup.sh | at the beginning of the backup
| 12-before-db-service | localdump.sh | before starting a backup of a backup type (mysql, sqlite, ...)
| 200-before-db-service | localdump.sh | before starting a backup of a backup type (mysql, sqlite, ...)
| 14-before-db-dump | unused
| 210-before-db-dump | unused
| 16-after-db-dump | unused
| 220-after-db-dump | unused
| 18-after-db-service | localdump.sh | after finishing a database type
| 230-after-db-service | localdump.sh | after finishing a database type
| 20-before-transfer | transfer.sh | before starting transfer of all directories
| 300-before-transfer | transfer.sh | before starting transfer of all directories
| 22-before-folder-transfer| transfer.sh | before starting transfer of a single directory
| 310-before-folder-transfer| transfer.sh | before starting transfer of a single directory
| 24-after-folder-transfer | transfer.sh | after transfer of a single directory
| 320-after-folder-transfer | transfer.sh | after transfer of a single directory
| 26-after-prune | transfer.sh | after pruning data
| 330-after-prune | transfer.sh | after pruning data
| 28-after-verify | transfer.sh | after verifying data
| 340-after-verify | transfer.sh | after verifying data
| 30-post-backup | transfer.sh | after all backup steps
| 400-post-backup | transfer.sh | after all backup steps
At the beginning the startup hook (10-before-backup) and the post hook (30-post-backup) for triggering a message might be the most common to use.
At the beginning the startup hook (100-before-backup) and the post hook (400-post-backup) for triggering a message might be the most common to use.
## Subdirs of a hook dir
## Subdirs of a hook dir
...
@@ -49,37 +49,37 @@ After execution of the scripts of "on-ok" or "on-error" additionally the found s
...
@@ -49,37 +49,37 @@ After execution of the scripts of "on-ok" or "on-error" additionally the found s
```txt
```txt
> tree -d hooks/
> tree -d hooks/
hooks/
hooks/
|-- 10-before-backup
|-- 100-before-backup
| `-- always
| `-- always
|-- 12-before-db-service
|-- 200-before-db-service
| `-- always
| `-- always
|-- 14-before-db-dump
|-- 210-before-db-dump
| `-- always
| `-- always
|-- 16-after-db-dump
|-- 220-after-db-dump
| |-- always
| |-- always
| |-- on-error
| |-- on-error
| `-- on-ok
| `-- on-ok
|-- 18-after-db-service
|-- 230-after-db-service
| |-- always
| |-- always
| |-- on-error
| |-- on-error
| `-- on-ok
| `-- on-ok
|-- 20-before-transfer
|-- 300-before-transfer
| `-- always
| `-- always
|-- 22-before-folder-transfer
|-- 310-before-folder-transfer
| `-- always
| `-- always
|-- 24-after-folder-transfer
|-- 320-after-folder-transfer
| |-- always
| |-- always
| |-- on-error
| |-- on-error
| `-- on-ok
| `-- on-ok
|-- 26-after-prune
|-- 330-after-prune
| |-- always
| |-- always
| |-- on-error
| |-- on-error
| `-- on-ok
| `-- on-ok
|-- 28-after-verify
|-- 340-after-verify
| |-- always
| |-- always
| |-- on-error
| |-- on-error
| `-- on-ok
| `-- on-ok
`-- 30-post-backup
`-- 400-post-backup
|-- always
|-- always
|-- on-error
|-- on-error
`-- on-ok
`-- on-ok
...
@@ -96,9 +96,9 @@ When processing a hook all files will be sorted in alphabetic order. Files start
...
@@ -96,9 +96,9 @@ When processing a hook all files will be sorted in alphabetic order. Files start
Before the backup starts we want to update some local information that we want to put as latest information.
Before the backup starts we want to update some local information that we want to put as latest information.
I have a script that gets the list of installed linux packages as a textfile. If my system is damaged and I need to reinstall it this list will help me to reinstall all applications and libraries.
I have a script that gets the list of installed linux packages as a textfile. If my system is damaged and I need to reinstall it this list will help me to reinstall all applications and libraries.
If my bash script that does the job is `/home/axel/scripts/list_packages.sh` ... and we let it run on each start of the backup. That's why we use the *10-before-backup* hook:
If my bash script that does the job is `/home/axel/scripts/list_packages.sh` ... and we let it run on each start of the backup. That's why we use the *100-before-backup* hook:
Create a file named *hooks/10-before-backup/always/10_list_packages.sh* which has the content:
Create a file named *hooks/100-before-backup/always/10_list_packages.sh* which has the content:
```sh
```sh
#!/usr/bin/env bash
#!/usr/bin/env bash
...
@@ -107,8 +107,8 @@ Create a file named *hooks/10-before-backup/always/10_list_packages.sh* which ha
...
@@ -107,8 +107,8 @@ Create a file named *hooks/10-before-backup/always/10_list_packages.sh* which ha
If you have the installation in a user directory keep in mind that the backup runs as root. Set executable permissions for root. If owner and group is your user then set exection permissions for the world: 0755:
If you have the installation in a user directory keep in mind that the backup runs as root. Set executable permissions for root. If owner and group is your user then set exection permissions for the world: 0755: