How to additionally clean-up Kodi MySQL database from unwanted entries

If you are like me using Kodi (XBMC) library to manage all your multimedia files you are probably used to updating and cleaning your library after adding or deleting new files.

My library at the moment consists of 15121 files total, but after examining it in PHPMyAdmin I have noticed that files table contains also some entries that point to non-existing idPath from path table and other files that are pointing to a path that is non-local (HTTP or plugin instead of regular system path). Continue reading “How to additionally clean-up Kodi MySQL database from unwanted entries”

How to delete files older than certain number of days

One thing that comes very handy is usage of cron to make scheduled job to delete old files so that you can free up some space on your hard drive

# Delete Apache logs older than 60 days
find /var/log/apache2/ -mtime +60 -exec rm {} \;

With this simple script you will search through Apache logs in folder /var/log/apache2, select the ones with access time older than +60 (60 days) and execute delete with rm command.