May 27, 201610 yr Every day at 03:00, Kodi runs a backup and saves the folder to an unRAID server. yyyymmdd0300 is the name, with the date changing for every new backup. I just deleted 201605260300, leaving 201605270300 as the only directory. Currently, I'm just opening a PuTTY window and running 'rm -rf dirname' every morning. It's about 5gb and ~70,000 files, so Windows take a LONG time to delete across the network when using Total Commander. I'd like to automate this process, taking great care to leave today's backup but deleting the yesterday's files. Saving location: mnt/user/Backup but I should probably make it's own share so nothing else goes there. I've looked at a few scripts, but they haven't accounted for a dir name that changes. At least the scripts I've found...
May 27, 201610 yr a quick script to run after the backup #!/bin/bash YESTERDAY=`date +%Y%m%d --date yesterday` BACKUPDIR=/mnt/usr/Backup BACKUP=${BACKUPDIR}/${YESTERDAY}0300 rm -fr ${BACKUP} of course i'd try it first with 'ls' in place of the 'rm -fr'
May 27, 201610 yr Author a quick script to run after the backup #!/bin/bash YESTERDAY=`date +%Y%m%d --date yesterday` BACKUPDIR=/mnt/usr/Backup BACKUP=${BACKUPDIR}/${YESTERDAY}0300 rm -fr ${BACKUP} of course i'd try it first with 'ls' in place of the 'rm -fr' Thanks, ken-ji. I'll give it a try.
May 30, 201610 yr Back when I used Kodi/XBMC I used an add-on that handled backing up the library to a share on my server for me. It had options to set how many backup copies you wanted to keep and it would delete anything older above that set threshold automatically. I don't remember exactly what the name was but I found it in the built in list of available add-one.
Archived
This topic is now archived and is closed to further replies.