I am still working on my script. It works fine using the code I "borrowed" from Webinoly (below), except for cases where the site is not active or the site is set up as a parked domain. When my script hits a my parked site, it still tries to back it up, but there's no directory for it in /var/www, so I get unexpected results. I could put in some logic to make sure there are files in the directory, but I am wondering if there's a way to get a list of only the active, non-parked-domain sites. I'm not skilled enough to understand your code, but I thought maybe there is an easy way. Here's the code:
source /opt/webinoly/lib/sites
# Generate array of sites (using part of List Sites command in webinoly)
for site in /etc/nginx/sites-available/*
do
domi=$(echo $site | cut -f 5 -d "/")
[[ -a /var/www/$domi ]] && sign="${gre} -" || sign="${blu} *${gre}"
[[ $domi != "default" && $domi != $(conf_read tools-port) ]] && SITEL$
done
#print site list
echo $SECONDS: SITE LIST
for SITE in ${SITELIST[@]}; do
echo $SECONDS: $SITE
done