1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-28 08:46:56 +00:00

Renew asciinema/screencasts

Created with borg v1.1.0, so more up-to-date and split into different
parts (install, basic, advanced)…
Fixes https://github.com/borgbackup/borg/issues/669
This commit is contained in:
rugk 2017-07-16 20:04:56 +02:00 committed by Thomas Waldmann
parent 9d758d56cd
commit df8205a4ba
8 changed files with 14088 additions and 5601 deletions

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,65 @@
# For the pro users, here are some advanced features of borg, so you can impress your friends. ;)
# Note: This screencast was made with borg version 1.1.0 older or newer borg versions may behave differently.
# First of all, we can use several environment variables for borg.
# E.g. we do not want to type in our repo path and password again and again…
export BORG_REPO='/media/backup/borgdemo'
export BORG_PASSPHRASE='1234'
# Problem solved, borg will use this automatically… :)
# We'll use this right away…
## ADVANCED CREATION ##
# We can also use some placeholders in our archive name…
borg create --stats --progress --compression lz4 ::{user}-{now} Wallpaper
# Notice the backup name.
# And we can put completely different data, with different backup settings, in our backup. It will be deduplicated, anyway:
borg create --stats --progress --compression zlib,6 --exclude ~/Downloads/big ::{user}-{now} ~/Downloads
# Or let's backup a device via STDIN.
sudo dd if=/dev/loop0 bs=10M | borg create --progress --stats ::specialbackup -
# Let's continue with some simple things:
## USEFUL COMMANDS ##
# You can show some information about an archive. You can even do it without needing to specify the archive name:
borg info :: --last 1
# So let's rename our last archive:
borg rename ::specialbackup backup-block-device
<up>
borg info :: --last 1
# A very important step if you choose keyfile mode (where the keyfile is only saved locally) is to export your keyfile and possibly print it, etc.
borg key export :: --qr-code file.html # this creates a nice HTML, but when you want something simpler…
< remove comment >
< let there: borg check > --paper # this is a "manual input"-only backup (but it is also included in the --qr-code option)
## MAINTENANCE ##
# Sometimes backups get broken or we want a regular "checkup" that everything is okay…
borg check -v ::
# Next problem: Usually you do not have infinite disk space. So you may need to prune your archive…
# You can tune this in every detail. See the docs for details. Here only a simple example:
borg prune --list --keep-last 1 --dry-run
# When actually executing it in a script, you have to use it without the --dry-run option, of course.
## RESTORE ##
# When you want to see the diff between two archives use this command.
# E.g. what happened between the first two backups?
borg diff ::backup1 backup2
# Ah, we added a file, right…
# There are also other ways to extract the data.
# E.g. as a tar archive.
borg export-tar --progress ::backup2 backup.tar.gz
ls -l
# You can mount an archive or even the whole repository:
mkdir /tmp/mount
borg mount :: /tmp/mount
ls -la /tmp/mount
borg umount /tmp/mount
# That's it, but of course there is more to explore, so have a look at the docs.

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,53 @@
# Here you'll see some basic commands to start working with borg.
# Note: This teaser screencast was made with borg version 1.1.0 older or newer borg versions may behave differently.
# But let's start.
# First of all, you can always get help:
borg help
# These are a lot of commands, so better we start with a few:
# Let's create a repo on an external drive…
borg init --encryption=repokey /media/backup/borgdemo
# This uses the repokey encryption. You may look at "borg help init" or the online doc at https://borgbackup.readthedocs.io/ for other modes.
# So now, let's create our first (compressed) backup.
borg create --stats --progress --compression lz4 /media/backup/borgdemo::backup1 Wallpaper
# That's nice, so far.
# So let's add a new file…
echo "new nice file" > Wallpaper/newfile.txt
<up>
borg create --stats --progress --compression lz4 /media/backup/borgdemo::backup2 Wallpaper
# Wow, this was a lot faster!
# Notice the "Deduplicated size" for "This archive"!
# Borg recognized that most files did not change and deduplicated them.
# But what happens, when we move a dir and create a new backup?
mv …
borg create --stats --progress --compression lz4 /media/backup/borgdemo::backup3 Wallpaper
# Still quite fast…
# But when you look at the "deduplicated file size" again, you see that borg also recognized that only the dir and not the files changed in this backup.
# Now lets look into a repo.
borg list /media/backup/borgdemo
# You'll see a list of all backups.
# You can also use the same command to look into an archive. But we better filter the output here:
borg list /media/backup/borgdemo::backup3 | grep 'deer.jpg'
# Oh, we found our picture. Now extract it…
mv Wallpaper Wallpaper.orig
borg extract /media/backup/borgdemo::backup3 <copy>
# And check that it's the same:
diff -s Wallpaper/deer.jpg Wallpaper.orig/deer.jpg
# And, of course, we can also create remote repos via ssh when borg is setup there. This command creates a new remote repo in a subdirectory called "demo":
borg init --encryption=repokey borgdemo@remoteserver.example:./demo
# Easy, isn't it? That's all you need to know for basic usage.
# If you want to see more, have a look at the screencast showing the "advanced usage".
# In any case, enjoy using borg!

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,21 @@
# This asciinema will show you the installation of borg as a standalone binary. Usually you only need this if you want to have an up-to-date version of borg or no package is available for your distro/OS.
# First, we need to download the version, we'd like to install…
wget -q --show-progress https://github.com/borgbackup/borg/releases/download/1.1.0b6/borg-linux64
# and do not forget the GPG signature…!
wget -q --show-progress https://github.com/borgbackup/borg/releases/download/1.1.0b6/borg-linux64.asc
# In this case, we have already imported the public key of a borg developer. So we only need to verify it:
gpg --verify borg-linux64.asc
# Okay, the binary is valid!
# Now install it:
sudo cp borg-linux64 /usr/local/bin/borg
sudo chown root:root /usr/local/bin/borg
# and make it executable…
sudo chmod 755 /usr/local/bin/borg
# Now check it: (possibly needs a terminal restart)
borg -V
# That's it! Check out the other screencasts to see how to actually use borgbackup.

File diff suppressed because it is too large Load diff

View file

@ -1,51 +0,0 @@
# borgbackup - installation and basic usage
# I have already downloaded the binary release from github:
ls -l
# binary file + GPG signature
# verifying whether the binary is valid:
gpg --verify borg-linux64.asc borg-linux64
# install it as "borg":
cp borg-linux64 ~/bin/borg
# making it executable:
chmod +x ~/bin/borg
# yay, installation done! let's make backups!
# creating a repository:
borg init repo
# creating our first backup with stuff from "data" directory:
borg create --stats --progress --compression lz4 repo::backup1 data
# changing the data slightly:
echo "some more data" > data/one_file_more
# creating another backup:
borg create --stats --progress repo::backup2 data
# that was much faster! it recognized/deduplicated unchanged files.
# see the "Deduplicated size" column for "This archive"! :)
# extracting a backup archive:
mv data data.orig
borg extract repo::backup2
# checking if restored data differs from original data:
diff -r data.orig data
# no, it doesn't! :)
# listing the repo contents:
borg list repo
# listing the backup2 archive contents (shortened):
borg list repo::backup2 | tail
# easy, isn't it?
# if you like #borgbackup, spread the word!