#!/bin/bash for script in /backup/scripts/*; do if ! grep -q '^function run_backup' "$script"; then continue fi if [ ! -x "$script" ]; then echo "Skipping $script because it is not executable" continue fi output="$("$script" 2>&1)" if [ "$?" -ne 0 ]; then echo "Failed to run: $script" echo "$output" fi done