diff options
-rw-r--r-- | README | 36 |
1 files changed, 31 insertions, 5 deletions
@@ -1,10 +1,14 @@ +Backup script +------------- + Backup script consists of 3 parts. 1) Source backuper.sh 2) Backup definition 3) Run command "backup" -Backup is defined by these parameters: +Available commands for backup definition +---------------------------------------- name - mandatory parametr; one word name of backup @@ -24,9 +28,23 @@ store_file - the result of backup should be stored in file store - specify command that stores backup +after - run command after successful backup (hook) + +result_file - get full path to file with backup + +file_type - (optionally) specify file type of backup; only with command backup (e.g. .sql for DB dumps) + +Configuration +------------- + +Backuper expects configuration file in $HOME/.backuper.sh.conf + +In configuration file is possible to specify there variables: -Example of backup script: +MBUFFER_SIZE - the size of each buffer (mbuffer utility) +GPG_RECIPIENTS - the list of GPG recipients of encrypted backup +Backup script example: ------------------------ #!/bin/sh @@ -36,16 +54,18 @@ Example of backup script: name "postgres" remote "ssh srv" generate "sudo -u postgres" +file_type "sql" # Optional cmd "pg_dumpall" store_file "/mnt/data/backups" backup ------------------------- +----- End of example script ----- -Examples of different backup definitions: +Examples of different backup definitions +---------------------------------------- -(without "name" parameter and "backup" command) +(Without "name" parameter and "backup" command.) 1) Backup all files from srv; exclude /proc, /sys/ and /dev and store it in file in /mnt/data folder: @@ -72,3 +92,9 @@ places "/" exclude "/proc" "/sys" "/dev" run "dpkg --get-selections > /tmp/list_of_packages" store_file "/mnt/data" + +5) Run hook after successful backup + +places "/etc /home /root" +store_file "/mnt/data" +after "cp $(result_file) /mnt/nas/backups/." |