added archive tree diff script...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-11-22 22:34:35 +03:00
parent b43d425ebc
commit 792ad8cc08

25
scripts/tree.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
TREE=`date +"%Y%m%d-%H%M"`
if ! [ -d ./.tree ] ; then
echo creating .tree directory...
mkdir .tree
attrib +H .tree
fi
echo building current tree...
tree -a -s --sort name -I '.tree*' > ./.tree/$TREE
echo setting LAST/CURRENT states...
[ -e ./.tree/CURRENT ] && cp ./.tree/CURRENT ./.tree/LAST
cp ./.tree/$TREE ./.tree/CURRENT
if [ -e ./.tree/LAST ] ; then
echo diff...
# XXX
diff ./.tree/LAST ./.tree/CURRENT
fi