How can I get Time Machine to backup /opt
on High Sierra?
You don't need to do anything special to back it up: Time Machine backs up all folders on your Mac.
However, you may get the impression that /opt
(and other folders like /bin
or /cores
, as you mention in your comment) are not included because the Finder hides those folders by default:
But don't let the Finder mislead you:
- either press ShiftCommand. to let the Finder display all folders (press ShiftCommand. again to hide them),
- or open Terminal, list the contents of the backup folder and you will see that everything is there:
How can I restore /opt
?
Proceed as follows:
- Open a Finder window.
- Enter Time Machine.
- Press ShiftCommandG and enter
/
to display the root folder of your drive.
- Press ShiftCommand. to display hidden folders. You should see
/opt
now.
- Browse the timeline on the right-hand side and select the desired date.
- Select
/opt
.
- Press Restore. Note that Time Machine will probably ask whether you want to keep a copy of your current files.
/opt
. What makes you think that/opt
isn't getting backed up? If you plug in your Time Machine drive, open theBackups.backupdb
folder, open the folder named like your Mac and then the folder with the most recent date, don't you see a subfolder namedopt
?/bin
,/cores
and other "Unix" folders, giving the (wrong) impression that they are not being backed up, but if you open Terminal, and runls -l
, you will see they are included. Check the screenshots in my answer below.