#!/bin/bash cd "$(dirname "$0")/data/photos/upload" || exit 1 while true; do if compgen -G "./*" > /dev/null; then rsync -a --remove-source-files -e 'ssh -p 2222' ./* mc@mc.ph87.de:/srv/fotobox.online/html/p/ fi sleep 3 done