[Digikam-users] Filesystem lost images - can digiKam report which ones?
Ben Staude
sben1783 at yahoo.de
Tue Sep 4 22:16:47 BST 2012
> > On Sun, Sep 2, 2012 at 8:36 AM, Ben Staude <sben1783 at yahoo.de> wrote:
> > Hi kyle,
> >
> > did you start DigiKam since you lost the images? If yes, do you have a recent
> > backup of its database?
>
> Backup? Hah! You're funny. :] Though the fact that I haven't been
> backing up for quite awhile is not so particularly funny. :[
Well, this might (should?) be the point to think again over whether a backup is worth the effort or not:) I use storeBackup and am really happy with it.
> > One possible route to go would be some perl (or the
> > like) script to "loop through all "Images" entries in digikams database and
> > check if the file exists in the filesystem".
>
> I was hoping digiKam had such a feature built-in. I feel like I
> remember it from a few years back, but that's probably just wishful
> thinking. If I do write such a script I'll be sure to share it here.
Here is some "script" you could start with (use on your own risk, probably deletes all remaining images:) ):
perl -e '@filesystem=split /\n/, `find /path/to/foto-collection -type f`; foreach $name (split /\n/, `sqlite3 /path/to/digikam4.db "select Name from Images;"`) { print "missing: $name\n" unless grep { /\/\Q$name\E$/ } @filesystem }'
This is a simple approach, but might yield some helpful results if you didn't rename or delete a lot of files in the past.
Regards
Ben
More information about the Digikam-users
mailing list