Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2223  / 1 Year ago, fri, february 3, 2023, 4:31:36

Last night, I used exiftool to batch rename a collection of .mov files. Some of the files were renamed as required, but many of them were left without an extension.



I think the required EXIF tag that I used in the exiftool command was missing from some the files, resulting in ~140 .mov files renamed in a timestamp format without an extension.



Rather than manually appending .mov to each file, I searched Google for a script to automate the process. I adapted an example and executed it (*+0100 refers to common string at the end of all the target files):



$ for i in *+0100; do mv "$i" "`basename $i *+0100`.mov"; done


For some reason, ~140 files disappeared and I was left with a single file with a .mov extension. Not quite what I was expecting!



I searched the partition with photorec, but I haven't been able to recover the files. Is there any other way I may be able to recover them? These particular family videos were some of the few that I had not yet backed up.


More From » bash

 Answers
2

See the DataRevovery.



Next time, when you do such loops always add echo as a first command. After you see what you are about to do, remove the echo, and rerun. It's a common mistake - sorry.


[#43171] Sunday, February 5, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mance

Total Points: 198
Total Questions: 105
Total Answers: 128

Location: South Georgia
Member since Mon, Aug 16, 2021
3 Years ago
;