kdbx-backup-script/backup.sh

18 lines
394 B
Bash

#!/bin/sh
_dest_dir='/mnt/4tb/data/backup/Pass'
_date=$(date +%s)
for _src_filename in *.kdbx; do
[ -e "$_src_filename" ] || continue
_dest="$_dest_dir/$_date-$_src_filename"
cp "$_src_filename" "$_dest"
done
echo "Backups:"
ls "$_dest_dir"
echo ""
echo "Backup location: $_dest_dir"
echo "Backup count: $(ls $_dest_dir | wc -l)"
echo "Backup size: $(du -hs $_dest_dir | cut -f1)"