#!/bin/bash cd /home/philip/web # url configuration URL="https://wittamore.com/" # values: always hourly daily weekly monthly yearly never FREQ="weekly" # begin new sitemap exec 1> sitemap.xml # print head echo '' echo '' echo '' # print urls IFS=$'\r\n' GLOBIGNORE='*' command eval "OPTIONS=($(cat $0.options))" find . -type f "${OPTIONS[@]}" -printf "%TY-%Tm-%Td%p\n" | \ while read -r line; do DATE=${line:0:10} FILE=${line:12} echo "" echo " ${URL}${FILE}" echo " $DATE" echo " $FREQ" echo "" done # print foot echo ""