31 lines
626 B
Bash
Executable File
31 lines
626 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# What to backup.
|
|
bfiles=".local/bin .ssh .gnupg .config .xstefenrc .gitconfig \
|
|
.bashrc .inputrc .nanorc .xprofile \
|
|
.android-certs android/utils android/stock"
|
|
|
|
# Where to backup to.
|
|
bdest="/mnt/seagate/Backups/"
|
|
|
|
# Create archive filename.
|
|
bdate=$(date +%Y%m%d)
|
|
bhost=$(hostname -s)
|
|
barchive="$bhost-$bdate.tgz"
|
|
|
|
# Print start status message.
|
|
echo "Backing up $bfiles to $bdest/$barchive"
|
|
date
|
|
echo
|
|
|
|
# Backup the files using tar.
|
|
tar czf $bdest/$barchive $bfiles
|
|
|
|
# Print end status message.
|
|
echo
|
|
echo "Backup finished"
|
|
date
|
|
|
|
# Long listing of files in $dest to check file sizes.
|
|
ls -lh $bdest
|