diff options
-rw-r--r-- | README | 74 |
1 files changed, 74 insertions, 0 deletions
@@ -0,0 +1,74 @@ +Backup script consists of 3 parts. + +1) Source backuper.sh +2) Backup definition +3) Run command "backup" + +Backup is defined by these parameters: + +name - mandatory parametr; one word name of backup + +cmd - command that is subject of backup; e.g. pg_dumpall + +places - string list of places for tar + +exclude - list of places that tar ignores + +generate - command that grants access to backup; e.g. sudo + +remote - run backup command at different server + +run - run command before backup; see examples + +store_file - the result of backup should be stored in file + +store - specify command that stores backup + + +Example of backup script: + +------------------------ + +#!/bin/sh + +. backuper.sh + +name "postgres" +remote "ssh srv" +generate "sudo -u postgres" +cmd "pg_dumpall" +store_file "/mnt/data/backups" + +backup + +------------------------ + +Examples of different backup definitions: + +(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: + +remote "ssh srv" +places "/" +exclude "/proc" "/sys" "/dev" +store_file "/mnt/data" + +2) Backup some files from local computer and send it to srv (ssh force-command take care about rest): + +places "/etc /home" +store "ssh srv" + +3) The same as 2; root is needed: + +places "/etc /home /root" +generate "sudo" +store "ssh srv" + +4) Run some important command before backup (on remote machine): + +remote "ssh root@srv" +places "/" +exclude "/proc" "/sys" "/dev" +run "dpkg --get-selections > /tmp/list_of_packages" +store_file "/mnt/data" |