#!/bin/bash LOCAL_DIR="/media/frigate" NFS_DIR="/mnt/nfs_frigate" # Check if NFS is mounted if mountpoint -q "$NFS_DIR"; then # Move files older than 1 day find "$LOCAL_DIR" -type f -mtime +1 -exec mv {} "$NFS_DIR" \; fi