From cbc35a8b9cd6982bb1af2e5966af3c2e1c2b9c82 Mon Sep 17 00:00:00 2001 From: dots Date: Wed, 2 Sep 2020 00:05:53 +0300 Subject: [PATCH] Add 'backup.sh' --- backup.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 backup.sh diff --git a/backup.sh b/backup.sh new file mode 100644 index 0000000..88717a6 --- /dev/null +++ b/backup.sh @@ -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)" \ No newline at end of file