Add 'backup.sh'
This commit is contained in:
parent
24febb3d0d
commit
cbc35a8b9c
|
@ -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)"
|
Loading…
Reference in New Issue