Photos

In the process of backing up, de-duplicating and collating all the photos from my laptop, the external storage HDD etc. I used the following:

$ du -sh Pictures/
du = disc usage
-sh = summarise, human-readable
Pictures/ = directory path

$ find Pictures/ -type f | wc -l 
find = find
Pictures/ = directory path
-type f = specify type as file
| wc -l = print newline counts (see wc --help for specifics)

So it basically lists all the files in Pictures/ but instead of outputting to a txt file it pipes the results to wc, which reads stdout as if it was a txt file, and returns newlines (each of which corresponds to a file). I don't know whether directories are omitted or not.

https://www.linux.com/learn/how-sort-and-remove-duplicate-photos-linux

Now I skip down to the bit about FSlint, only I install rmlint instead, which seems to be the commandline equivalent recommended by Arch.

$ rmlint 

On it's own looks for empty and duplicate files in the current directory. It generates a script that'll remove them if you run it (rmlint.sh).

 After a bit of sanity checking I went ahead and did that. Saved myself 1 gig in the builds folder and over 7 gig in the pictures folder.

Next I installed ExifTools (perl-image-exiftools in the Arch repos), and after a bit of trial and error, settled on

$ exiftool -o . '-Directory<CreateDate' -d ~/PhotoBackup/Photos/20%
y/20%y-%m -r ~/Pictures

Which copies images recursively from old to new locations, creating named folders on the fly.

That's where I'm up to right now. It's telling me that 366 images out of 4750 have not been copied across due to errors, so I don't know what I'm going to do about that. Anyhoo, not bad going.


Comments

Popular posts from this blog

no sound in Papers Please

pdf to png/jpg/etc

Crunchbang Changes