|
snork wrote this -
#!/bin/sh
#
# 2023-04-18
# 1. Set $NUMDAYS to the number of days of results you wish to keep.
# Default value is 3, minimum value is 1.
# 2. Set $PANOPATH to the location of apt_panopticon files without trailing slash.
# Default value is /var/www/html/apt-panopticon/apt-panopticon.
# 3. Run this script daily (probably via cron). Example crontab entry:
# 5 1 * * * /var/www/html/apt-panopticon/apt-panopticon/trimresults.sh
# 4. If any cron runs are missed, you may have to manually rm the missed entries.
NUMDAYS=3
PANOPATH="/var/www/html/apt-panopticon/apt-panopticon"
rm -R ${PANOPATH}/results_$(date -d "${NUMDAYS} days ago" "+%Y-%m-%d")*
|