Something unexpected just occurred as I worked to copy some text files into the ‘albums’ directory of my Gallery install – all the albums directories vanished. Alas!

Uh-oh. Regarding ‘mv’:

As the rename(2) call does not work across file systems, mv uses cp(1) and rm(1) to accomplish the move. The effect is equivalent to:

rm -f destination_path &&

cp -PRp source_file destination &&

rm -rf source_file

Thus the effect of applying ‘mv’ like this:

mv * /path/to/intended/destination/*

will result in the removal of the files in the destination directory.

oddly, the command was not issued with -r and thus I would have expected it to error out on the first directory it encountered. Shit. Hope one of my ancient backups is about.

if not, back to Galleryadd.pl. Or maybe install G2 from scratch and then do the import.