#!/bin/bash

SRC=/data/mnt/move/movies/
DST=/mnt/union/movies/

if [ -d "$SRC" ]; then
  rsync -avzhP -e "ssh -o StrictHostKeyChecking=no" --remove-source-files --progress "$SRC" root@vmx-nas.swallow-grue.ts.net:"$DST" \
  &&  find "$SRC" -type d -empty -delete
fi



SRC=/data/mnt/move/series/
DST=/mnt/union/series/
if [ -d "$SRC" ]; then
  rsync -avzhP -e "ssh -o StrictHostKeyChecking=no" --remove-source-files --progress "$SRC" root@vmx-nas.swallow-grue.ts.net:"$DST" \
  &&  find "$SRC" -type d -empty -delete
fi