September 18, 20205 yr Hi, I have a bunch of videos that I want to upload to Google Photos. They need to have their extensions changed, but I want to preserve the date/time of the files so they are indexed properly. Is there a single command that I can run that will: Recursively go through a directory and subdirectories and rename any file ending in '.foo' with '.bar' Do NOT update the file date/time I've done some research on this online and it appears there are several approaches to do one or the other, but I cannot determine the best way to combine the two. I am also a little gun-shy as a n00b and I really only have one shot at this, if I screw up the dates/times they're not recoverable. Thanks in advance!
September 18, 20205 yr Community Expert Since this is your first post here and you don't mention it, are you talking about doing this on Unraid?
September 18, 20205 yr Author Yes I am... I figured I'd start here although this is more of a generic FreeBSD question.
September 18, 20205 yr You would probably need to 'copy' the source file to the destination using the --preserve=all option followed by deleting the source file (move [mv] doesn't allow to preserve timestamps). i.e. cp --preserve=all [source] [destination] rm [source] I'm not big on making scripts so perhaps someone else can help with that, or you can attempt it yourself. Might want to not remove anything until you are sure it works, or create a dummy directory and files to test on.
Archived
This topic is now archived and is closed to further replies.