RemoveOlderThanAllowsSubdirectories
From RdiffBackupWiki
Request
Currently (as of 1.0.0) --remove-older-than does not allow you to specify a subdirectory. So if you back up /var, for example, but only want to keep things in /var/log for a few days, it's difficult to do.
I just tried to set something up to get around this like so, but my archive isn't old enough yet to know if it works... :)
for i in $TMPDIRS; do
echo "Removing increments older than ${MAXTMPAGE} in ${BACKDIR}/${HOST}/${i}" >> $LOGFILE
CMD="$RDIFF --remove-older-than ${MAXTMPAGE} --force --print-statistics --include ${i} --exclude '**' ${BACKDIR}/${HOST}/ >> $LOGFILE"
echo $CMD >> $LOGFILE
eval $CMD
done
Best.
rpeterso at mtholyoke dot edu
Use Cases
It seems to me that as long as you could specify a path (not just a directory) this could solve many problematic use cases.
- Accidentally backing up large amounts of data and wanting to remove it RemoveSpecifiedFiles
- (Is it true as suggested in RemoveSpecifiedFiles that you can just remove the increment safely?)
- Having parts of the repository that you want to have different ages on (as above in the request)
- Moving large file (say rearranging media file) (see DetectMoves). With partial repo aging, you could clean up the old copy of the files a few months later. Of course you'd lose your older increments, but in many cases these files are static, and very large, so that may not be a problem. It seems that DetectMoves is hard, but this request might be much easier.
Questions
Can someone let me know if you can just safely delete the increment files, because if you could, it seems this feature request can be done manually, although this would make it much harder and more dangerous to automate.
Craig 14:19, 7 September 2008 (EST)
