#!/bin/bash
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
SRC="/var/www/html/public/circuitx"
BACKUP_DIR="$SRC/backups/$TIMESTAMP"

mkdir -p "$BACKUP_DIR"

for cam in cam01 cam02 cam03 cam04 cam05; do
    mv "$SRC/$cam" "$BACKUP_DIR/"
    mkdir -p "$SRC/$cam"
done

cp -r "$SRC/master" "$BACKUP_DIR/"

echo "Backup moved to: $BACKUP_DIR"
