#!/bin/bash
#                       /usr/local/bin/galleries.tails2fey
# https://crystalfaeries.net/posix/bin/galleries.tails2fey
# celeste:crystalfaery GALLERIES.TAILS2FEY 2017-04-18 22:12:19+00:00
# a quick hack to merge backup files
# from a USB thumb drive TAILS Persistent storage
# to our hard disk hierarchy on laptop fey

# Manually ensure the persistent partition is mounted, then:
pushd /media/celeste/TailsData/Persistent/celeste/galleries/

# We are dancing not with correct algorithm here,
# but with disk fullness on target (GACK!)

for d in *
do
echo	"=======	$d	======="
	rsync -auvzH $d /home/galleries
	df --full
echo	"=======	$d	======="
	pushd /home/galleries/$d
		imagescape .
	popd
	df --full
echo	"=======	/home/galleries	======="
	pushd /home/galleries
		fdedupe -f
	popd
	df --full
done
cd	/home
sudo chmod g+w .
sudo umount /home/www
fdedupe -f


syntax highlighted by Code2HTML, v. 0.9.1