stacks/homelab/service-sync/run

29 lines
457 B
Plaintext
Raw Normal View History

2023-12-28 11:08:58 -07:00
#! /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