31 lines
1.2 KiB
Bash
Executable File
31 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# Auto-sync critical files from WEVADS to Arsenal
|
|
# Run via cron every 5 minutes
|
|
|
|
SRC=/opt/wevads/public
|
|
DST=/opt/wevads-arsenal/public
|
|
|
|
# Critical API files
|
|
for f in profit-orchestrator.php conversion.php brain-unified-send.php adx-tag-engine.php adx-send-bridge.php getadxrtl.php sentinel-brain.php conversions-collector.php; do
|
|
if [ -f "$SRC/api/$f" ]; then
|
|
src_md5=$(md5sum "$SRC/api/$f" | cut -d' ' -f1)
|
|
dst_md5=$(md5sum "$DST/api/$f" 2>/dev/null | cut -d' ' -f1)
|
|
if [ "$src_md5" != "$dst_md5" ]; then
|
|
cp "$SRC/api/$f" "$DST/api/$f"
|
|
echo "$(date '+%Y-%m-%d %H:%M:%S') SYNCED: api/$f" >> /var/log/arsenal-sync.log
|
|
fi
|
|
fi
|
|
done
|
|
|
|
# Critical HTML/PHP pages
|
|
for f in profit-orchestrator.html ceo-dashboard.html ceo-deliverads.php ceo-pilotage.php deliverability-hub.php; do
|
|
if [ -f "$SRC/$f" ]; then
|
|
src_md5=$(md5sum "$SRC/$f" | cut -d' ' -f1)
|
|
dst_md5=$(md5sum "$DST/$f" 2>/dev/null | cut -d' ' -f1)
|
|
if [ "$src_md5" != "$dst_md5" ]; then
|
|
cp "$SRC/$f" "$DST/$f"
|
|
echo "$(date '+%Y-%m-%d %H:%M:%S') SYNCED: $f" >> /var/log/arsenal-sync.log
|
|
fi
|
|
fi
|
|
done
|