0

I ran a batch rename of all files named index.html to index.php with Automator - I meant to run it on a specific folder and instead ran it on my whole computer. I can't undo the changes as far as I know (no time machine backup either). Does automator have a log of the files that were changed?

1

Automator doesn't keep a log file, if you didn't include some logging routine in the action itself.

You should be able to find all falsely renamed index.html files by checking the modify date of superior folders: search for all files with the name index.php and check if the modify date of the superior folder is the same as the execution date of the Automator action. If the modify date is the same, the file (not located at the "specific" folder) was renamed unintentionally. If the modify date of the superior folder is earlier than the Automator action execution date the file wasn't renamed.

To get all folders containing a file index.php quickly, enter:

sudo find / -type f -name 'index.php' |sed 's#\(.*\)/.*#\1#' |sort -u

To get a list of folders sorted by modify date with ls use something like this:

ls -dl $(find / -type f -name 'index.php' |sed 's#\(.*\)/.*#\1#')

The last command doesn't work for paths containing spaces!

  • Thanks - Is it possible to filter the search by modified date rather than just sorting them by modified date? The results don't indicate when they were modified. – mheavers Oct 27 '16 at 22:11
  • @mheavers Just use another option like -dl instead of -dt. I still have to find a search expression which doesn't exclude paths containing spaces though! – klanomath Oct 27 '16 at 23:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .