#! /bin/sh set -e exec 2>&1 echo "=== Copying newer files" cd /etc/service find . \ ! -path './*/supervise*' \ ! -path './*/log/lock' \ ! -path './*/log/current' \ ! -path './*/log/@*' \ | cpio -R neale -m -p /home/neale/src/stacks/homelab echo "=== Removing deleted files" cd /home/neale/src/stacks/homelab find */ \ | while read fn; do if ! [ -e /etc/service/"$fn" ]; then echo " - $fn" rm -rf "$fn" fi done echo "=== Waiting..." sleep 4h