Add 'backup.sh'

This commit is contained in:
dots 2020-09-02 00:05:53 +03:00
parent 24febb3d0d
commit cbc35a8b9c
1 changed files with 18 additions and 0 deletions

18
backup.sh Normal file
View File

@ -0,0 +1,18 @@
#!/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)"