It seems that Time Machine does not backup system.log in /private/var/log.
Mac OS X 10.9.5/Six core Intel Xeon
Can I force that file to be backed up?
backuplogsmacostime-machine
It seems that Time Machine does not backup system.log in /private/var/log.
Mac OS X 10.9.5/Six core Intel Xeon
Can I force that file to be backed up?
Best Answer
By default the contents of the
/private/var/log
directory is excluded from Time Machine backups. This can be changed to include the contents however because this is a system file it is probably more prudent to backup the excluded files you would like to have backed up by copying the files to a location that is included in Time Machine backups. That said however, I disagree with cppl's statement "Given that changing core files is always a bad idea" because when done properly and with the knowledge and understanding of what one is doing it's just not an issue!If you really want to include
/private/var/log
directory in your Time Machine backups then here is what you can do. To make this easier and more safe I'd recommend using this tested script. It first backs up the bundle and plist and only removes/private/var/log
if it in its default location within the .plist file. Note: This script must be run usingsudo
or asroot
.In a Terminal:
In the opened modtm document:
Copy and paste the code shown below into the document and save it, then close it.
Back in the the Terminal, make the script executable:
Now with the script ready to execute, in the Terminal:
Enter your password, which will not show as you type it, and then press Enter.
If defaults were in play then
/private/var/log
should have been safely removed, by virtue of first backing up, from the StdExclusions.plist file.Code:
Image showing syntactical highlighting:
Note: This script cannot be run in OS X 10.11 unless SIP is temporarily disabled.