#!/bin/bash # Backup script meant for backing up stuff that is not managed by $env # Usage: bash backup.sh /path/to/target/ # Requires: root privileges # Requires: deployment of environment # Set backup location here target=$1 timestamp=$(date +%F_%T%z) # Make a timestamped directory there. mkdir -v "$target"homeprofile_backup_"$timestamp" # Make what has been bade by mkdir and put that into a variable called $tdir. tdir="$target"homeprofile_backup_"$timestamp"/ # rsync -avpPhR = rsync --archive --verbose --perms --partial --progress --human-readable --relative # Backup Chromium profile rsync -avpPhR ~/.config/chromium "$tdir" # Backup weechat stuff rsync -avpPhR ~/.weechat "$tdir" # Backup SSH stuff rsync -avpPhR ~/.ssh /etc/ssh "$tdir"