From f7da7a55259b0504bf15e033d81c8309e110edb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Parilli?= Date: Wed, 13 Dec 2023 18:37:34 -0400 Subject: [PATCH] Fixed markdown syntax for exmaple commands --- README.md | 82 ++++++++++++++++++++++--------------------------------- 1 file changed, 33 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index c21a3e5..d576911 100644 --- a/README.md +++ b/README.md @@ -42,39 +42,29 @@ Under issues or bugs found with backup/restore tools that aren't related with th ### Full Backup - -`docker run --rm \` - -`-v /run:/run -v /var/tmp:/var/tmp -v /mnt/backups:/mnt/backups \` - -`adrianparilli/virtnbdbackup-docker \` - -`virtnbdbackup -d -l full -o /mnt/backups/` - - +``` +docker run --rm \ +-v /run:/run -v /var/tmp:/var/tmp -v /mnt/backups:/mnt/backups \ +adrianparilli/virtnbdbackup-docker \ +virtnbdbackup -d -l full -o /mnt/backups/ +``` ### Incremental Backup - -`docker run --rm \` - -`-v /run:/run -v /var/tmp:/var/tmp -v /mnt/backups:/mnt/backups \` - -`adrianparilli/virtnbdbackup-docker \` - -`virtnbdbackup -d -l inc -o /mnt/backups/` - +``` +docker run --rm \ +-v /run:/run -v /var/tmp:/var/tmp -v /mnt/backups:/mnt/backups \ +adrianparilli/virtnbdbackup-docker \ +virtnbdbackup -d -l inc -o /mnt/backups/ +``` ### Backup Restoration - -`docker run --rm \` - -`-v /run:/run -v /var/tmp:/var/tmp -v /mnt/backups:/mnt/backups -v /mnt/restored:/mnt/restored -v /etc/libvirt/qemu/nvram:/etc/libvirt/qemu/nvram \` - -`adrianparilli/virtnbdbackup-docker \` - -`virtnbdrestore -i /mnt/backups/ -a restore -o /mnt/restored` - +``` +docker run --rm \` +-v /run:/run -v /var/tmp:/var/tmp -v /mnt/backups:/mnt/backups -v /mnt/restored:/mnt/restored -v /etc/libvirt/qemu/nvram:/etc/libvirt/qemu/nvram \ +adrianparilli/virtnbdbackup-docker \ +virtnbdrestore -i /mnt/backups/ -a restore -o /mnt/restored +``` Where `/mnt/restored` is an example folder in your system, where virtnbdrestore will rebuild virtual disk(s) based on existing backups, with its internal block device name, such as 'sda', 'vda', 'hdc', etc. @@ -84,36 +74,30 @@ Mount point `/etc/libvirt/qemu/nvram` is required when involved backup includes You can also run the container in interactive mode by running its build in shell, and then execute multiple backup/restoration commands, as needed. This also very is useful for debugging purposes: - -`docker run -rm -it \` - -`-v /var/tmp:/var/tmp -v /run:/run -v /mnt/backups:/mnt/backups -v /mnt/restored:/mnt/restored' \` - -`adrianparilli/virtnbdbackup-docker \` - -`/bin/bash` - +``` +docker run -rm -it \ +-v /var/tmp:/var/tmp -v /run:/run -v /mnt/backups:/mnt/backups -v /mnt/restored:/mnt/restored \ +adrianparilli/virtnbdbackup-docker \ +/bin/bash +``` and execute commands as desired. The container will keep running until you type `exit` on the internal shell. ### Persistent container In the above examples, the container will be removed as soon the invoked command has been executed. This is the optimal behaviour when you intend to automatize operations, such as incremental backups. In addition, you can set a persistent container with all necessary bind mounts with: - -`docker create --name \` - -`-v /var/tmp:/var/tmp -v /run:/run -v /mnt/backups:/mnt/backups -v /mnt/restored:/mnt/restored' \` - -`adrianparilli/virtnbdbackup-docker \` - -`/bin/bash` - +``` +docker create --name \ +-v /var/tmp:/var/tmp -v /run:/run -v /mnt/backups:/mnt/backups -v /mnt/restored:/mnt/restored' \ +adrianparilli/virtnbdbackup-docker \ +/bin/bash +``` Just creating a new container (with custom name) with mount points set and ready to run in interactive mode. To start it and automatically enter into the internal shell, just type: - -`docker start -i ` - +``` +docker start -i +``` And again, stopping it with the command `exit` from its shell.