#!/bin/bash bulist="/usr/local/etc/du-list" logdir="/usr/local/log" curhost=$(hostname) buuser="buuser" remhost="files.lan" rembase="/volumeUSB1/usbshare/rsync-backups/${curhost}_backups" budst="rsync://${buuser}@${remhost}//${rembase}" curDay=$(date +%d) echo "Duplicity cleanup run for ${curhost} beginning at $(date +%Y%m%d-%H%M%S)" >> ${logdir}/duplicity_cleanup_run.log list=$(cat ${bulist}) for i in $list do buname=$(echo $i | sed 's/\//_/g' | sed 's/^_//g') bulog="${logdir}/duplicity_${buname}_$(date +%Y%m%d-%H%M%S)_cleanup_run.log" /usr/bin/duplicity remove-all-but-n-full 2 --force --no-encryption ${budst}/${buname} 2>&1 >> ${bulog} done echo "Duplicity cleanup run completed at $(date +%Y%m%d-%H%M%S)" >> ${logdir}/duplicity_cleanup_run.log