cat /etc/modprobed_db.conf # Make sure that the user you plan to run the script as has r/w to the path! dbpath="/var/log" # no trailing / # Add modules in the ignore array that you do NOT want counted, for example # modules that get build by their respective package. ignore=(nvidia vboxdrv vboxnetflt vboxnetadp lirc_dev lirc_i2c) ls -l /var/log total 36420 drwxrwxrwt 4 root root 400 Apr 18 14:00 ./ drwxr-xr-x 18 root root 440 Apr 14 14:10 ../ -rw-r----- 1 root log 409 Apr 18 13:59 acpid.log -rw-r----- 1 root log 4540 Apr 18 20:32 auth.log drwxr-xr-x 2 root root 60 Apr 18 13:59 ConsoleKit/ -rw-r----- 1 root log 66170 Apr 18 20:33 crond.log -rw-r----- 1 root log 18236516 Apr 18 20:33 daemon.log -rw-r--r-- 1 root root 56760 Apr 18 13:59 dmesg.log -rw-r----- 1 root log 1022 Apr 18 14:16 errors.log -rw-r----- 1 root log 18468681 Apr 18 20:33 everything.log -rw------- 1 root root 32032 Apr 18 13:59 faillog -rw-r----- 1 root log 107701 Apr 18 20:21 kernel.log -rw-r--r-- 1 root root 292292 Apr 18 13:59 lastlog -rw-r----- 1 root log 57509 Apr 18 20:33 mail.log -rw-r----- 1 root log 90884 Apr 18 20:32 messages.log -rw-r--r-- 1 mememe users 15207 Apr 18 20:29 mpdscribble.log -rw-r--r-- 1 root root 1039 Apr 18 20:32 pacman.log -rw-r----- 1 root log 82 Apr 18 13:59 syslog.log drwxr-xr-x 2 root root 60 Apr 18 13:59 wicd/ -rw-r--r-- 1 root users 26442 Apr 18 13:59 Xorg.0.log sudo modprobed_db No db present so making /var/log/modprobed.db The db currently contains this many records: 106 Which has ls -l /var/log create these two more lines: -rw-r--r-- 1 root root 979 Apr 18 20:34 modprobed.db -rw-r--r-- 1 root root 979 Apr 18 20:34 modprobed.long