diff options
| author | Mitsuo Tokumori <[email protected]> | 2025-05-28 22:08:02 +0900 |
|---|---|---|
| committer | Mitsuo Tokumori <[email protected]> | 2025-05-28 22:08:02 +0900 |
| commit | 31c7dcb823b6a05981aa5487d8cf08ece7b8bc3e (patch) | |
| tree | dd71cc31dfbe1ba81ad9d1723e34dcebff8445fa /public/.local/bin/laptop-backup.sh | |
| parent | 47b726b9b90655e31d1abcac2976f730d789bc76 (diff) | |
| download | dotfiles-31c7dcb823b6a05981aa5487d8cf08ece7b8bc3e.tar.gz dotfiles-31c7dcb823b6a05981aa5487d8cf08ece7b8bc3e.tar.bz2 dotfiles-31c7dcb823b6a05981aa5487d8cf08ece7b8bc3e.zip | |
bump
Many small changes. Maybe the most significan is update the terminal
font size in `st` config.h for better visibility.
Diffstat (limited to 'public/.local/bin/laptop-backup.sh')
| -rwxr-xr-x | public/.local/bin/laptop-backup.sh | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/public/.local/bin/laptop-backup.sh b/public/.local/bin/laptop-backup.sh index 0fcd0cd..64f39b0 100755 --- a/public/.local/bin/laptop-backup.sh +++ b/public/.local/bin/laptop-backup.sh @@ -1,6 +1,18 @@ #!/bin/bash # Fast backup using rsync +# +# This script is meant to be executed manually every so often (weekly, monthly). +# If an automatic solution where to be made (e.g., run daily via cron job). +# Then make sure the rsync target is always the same (e.g., minipc:/mnt/backup) +# and the `--delete` flag is NOT used (you'll need to figure out a way to +# "purge" duplicated files in the backup storage every so often). +# +# Steps: +# 1. Connect external storage device and get the block device path (`lsblk`) +# 2. Run this script +# +# See also: http://wiki.pulse15/index.php?title=Backup if [ $# -ne 2 ]; then echo "Usage: $(basename "$0") /dev/sdX backup" @@ -13,10 +25,14 @@ if [ "$(id -u)" -ne 0 ]; then fi rsync_options="-auvP --delete" +# path of the device (block device file) (e.g., /dev/sda) device=$1 +# cryptsetup name (e.g., backup) name=$2 -# Note: `name` (nor `device`) should not contain spaces +# FIXME +# Everything breaks if `name` or `device` contain spaces. Exit if that's the +# case. cryptsetup open --type luks $device $name if [ $? -ne 0 ]; then @@ -24,7 +40,8 @@ if [ $? -ne 0 ]; then exit 1 fi mount /dev/mapper/$name /mnt/$name -# TODO: stop backing up /var. Backup is just for Postgres and Mediawiki. +# TODO +# Stop backing up /var. Backup is just for Postgres and Mediawiki. # `/var` is used by too many applications. Specialy pacman that clutters it # with cached binaries. rsync $rsync_options /var /mnt/$name # <10G |
