Are you getting notifications about a full Time Machine drive? Do you feel like your backups are taking too long? A bigger, faster hard drive might be the best solution, but you can also help by excluding particular folders from your backups.
您是否收到有关Time Machine完整驱动器的通知? 您是否觉得备份时间太长? 更大,更快的硬盘驱动器可能是最好的解决方案,但是您也可以通过从备份中排除特定文件夹来提供帮助。
We’ve shown you how to back up and restore files with Time Machine, including how to exclude particular folders from being backed up. To exclude a folder, just head to System Preferences > Time Machine > Options.
我们向您展示了如何使用Time Machine备份和还原文件,包括如何从备份中排除特定文件夹。 要排除文件夹,只需转到系统偏好设置> Time Machine>选项。
Some more options will slide down, giving you the ability to exclude particular folders from your backups. But which folders can be safely disabled? And are any disabled by the system already? Let’s take a look.
其他一些选项将向下滑动,使您能够从备份中排除特定文件夹。 但是可以安全地禁用哪些文件夹? 系统已经禁用了吗? 让我们来看看。
默认情况下,Time Machine排除什么? (What Does Time Machine Exclude By Default?)
Time Machine already excludes a bunch of things you don’t need backed up: your Trash, caches, and indexes. And you know how you can use Time Machine even if your drive isn’t plugged in? The local backups that make that possible are also not backed up, as that would be redundant. So you don’t need to worry about excluding system-level things like logs and caches—Time Machine already has you covered.
Time Machine已经排除了许多不需要备份的内容:废纸,、缓存和索引。 而且您知道即使未插入驱动器也可以使用Time Machine? 也不会备份使备份成为可能的本地备份,因为这将是多余的。 因此,您不必担心排除诸如日志和缓存之类的系统级内容-Time Machine已经为您服务。
If just knowing that system-level stuff is already excluded is enough for you, go ahead and skip the rest of this section. But if you’re interested in seeing the complete list of folders excluded by default (or just want to prove to yourself that something is excluded), here’s how to do it.
如果仅知道已经排除了系统级的内容就足够了,请继续并跳过本节的其余部分。 但是,如果您希望查看默认情况下排除的文件夹的完整列表(或者只是想向自己证明某些东西被排除在外),请按照以下方法操作。
A file named “StdExclusions.plist” outlines everything that Time Machine excludes. You can find that file in the following location:
名为“ StdExclusions.plist”的文件概述了Time Machine排除的所有内容。 您可以在以下位置找到该文件:
/System/Library/CoreServices/backupd.bundle/Contents/Resources/
You can quickly open that file by running the following command in the Terminal (which you can find at Applications > Utilities > Terminal):
您可以通过在终端中运行以下命令来快速打开该文件(可以在“应用程序”>“实用程序”>“终端”中找到):
/System/Library/CoreServices/backupd.bundle/Contents/Resources/StdExclusions.plist
The list is too long to include here, so you should just check it out yourself.
该列表太长,无法包含在此处,因此您应该自己检查一下。
Individual programs can also mark particular files to not be backed up. Typically, this includes caches and other temporary files. You can find a list of these exempt files by running the following command in the Terminal:
各个程序还可以将特定文件标记为不备份。 通常,这包括缓存和其他临时文件。 您可以通过在终端中运行以下命令来找到这些免除文件的列表:
sudo mdfind "com_apple_backup_excludeItem = 'com.apple.backupd'"
To summarize, though, you don’t need to worry about stopping Time Machine from backing up caches or your Trash folder, because it already knows not to. And a big thanks to Brant Bobby on Stack Exchange for pointing out the commands that prove this.
总之,尽管如此,您不必担心停止Time Machine备份缓存或“垃圾箱”文件夹,因为它已经知道不这样做。 非常感谢Stack Exchange上的Brant Bobby指出了证明这一点的命令。
我应该考虑排除哪些其他项目? (What Other Items Should I Consider Excluding?)
Now that you’ve seen what Time Machine excludes by default, let’s take a look at some of the other items you might consider excluding to free up some space.
既然您已经了解了Time Machine默认排除的内容,让我们看一下您可能考虑排除的其他一些项目,以释放一些空间。
您的Dropbox文件夹或任何已经同步的文件夹 (Your Dropbox Folder, or Any Folder You’re Already Syncing)
If you’re using Dropbox, OneDrive, Google Drive, or any other syncing service, you already have those files stored in at least two locations—on your local drive and in the cloud. If you’re syncing files to other devices, as well, then you have those files stored in other locations as well.
如果您使用的是Dropbox,OneDrive,Google Drive或任何其他同步服务,则这些文件已经存储在至少两个位置(本地驱动器和云中)。 如果还要将文件同步到其他设备,那么这些文件也将存储在其他位置。
Just be careful. Most cloud services offer a grace period to recover deleted files. Dropbox, for example, gives you 30 days, and keeps older versions of the files it has—just like a backup. But if your cloud service does not provide this feature, you probably don’t want to exclude those files from your Time Machine backup, since you may not be fully covered if you accidentally delete an important file. Keeping that caveat in mind, though, you can probably leave such folders out of your Time Machine backups.
请注意。 大多数云服务都提供宽限期来恢复已删除的文件。 例如,Dropbox会给您30天的时间,并保留其拥有的旧版本文件-就像备份一样。 但是,如果你的云服务不提供此功能,你可能不希望从您的Time Machine备份排除这些文件,因为你可能无法完全覆盖,如果你不小心删除了某个重要文件。 不过,请记住这一点,您可以将此类文件夹排除在Time Machine备份之外。
您的虚拟机 (Your Virtual Machines)
If you’ve created virtual machines to use Windows or Linux applications on your Mac, it’s probably a good idea to exclude those from your backup. Each virtual hard drive is a single file, meaning every time you use your virtual machine, a 20 GB+ file needs to be re-backed up. This is less of a problem if you use Parallels, which is built with this in mind, but other virtual machines can struggle with it.
如果已创建虚拟机以在Mac上使用Windows或Linux应用程序,则最好将这些虚拟机从备份中排除。 每个虚拟硬盘驱动器都是一个文件,这意味着每次使用虚拟机时,都需要重新备份20 GB以上的文件。 如果您使用了Parallels ,那么这个问题就更少了, Parallels就是为此而构建的,但是其他虚拟机可能会为此而苦苦挣扎。
We recommend doing a one-time backup of your virtual machines to some other hard drive and excluding them from your Time Machine backups.
我们建议一次性将虚拟机备份到其他硬盘,并将其从Time Machine备份中排除。
您的Steam库和其他游戏 (Your Steam Library, and Other Games)
If you play a lot of Steam games on your Mac, you probably don’t need to back them up. After all, getting your games back is as easy as opening Steam and re-downloading them.
如果您在Mac上玩了很多Steam游戏,则可能不需要备份它们。 毕竟,恢复游戏就像打开Steam并重新下载一样容易。
To find where your Steam games are located, you’ll need to know how to access the hidden Library folder on your Mac. You can find the Steam settings folder at the following location
要查找Steam游戏的位置,您需要知道如何访问Mac上隐藏的Library文件夹。 您可以在以下位置找到Steam设置文件夹
~/Library/Application Support/Steam
The games themselves are stored in the steamapps
folder. Exclude that folder and you’ll save a bunch of storage space without really losing anything that you can’t get back quickly. Your game save files are saved elsewhere in the Library folder, so you won’t need to worry about losing them by excluding the steamapps folder.
游戏本身存储在steamapps
文件夹。 排除该文件夹,您将节省大量存储空间,而不会真正丢失您无法快速取回的任何内容。 您的游戏保存文件保存在“库”文件夹中的其他位置,因此您无需担心会由于排除steamapps文件夹而丢失它们。
And this advice doesn’t apply just to Steam games, either. Games in general tend to be very large, and are easy to re-download should you need to—no reason to waste backup space on them.
这个建议也不仅仅适用于Steam游戏。 通常,游戏通常非常大,并且在需要时易于重新下载-没有理由浪费游戏的备份空间。
We recommend putting all of your games in a separate folder, and then excluding that folder from your Time Machine backups.
我们建议将所有游戏都放在单独的文件夹中,然后从Time Machine备份中排除该文件夹。
您可以轻松取回的大型应用程序 (Large Applications You Can Easily Get Back)
If you’re still running out of space, you might want to apply the same logic used for games to other large applications. Head to your Applications folder and look for large programs that you could easily reinstall. Things like Microsoft Office and Adobe Creative Suite are easy to re-download later, and constant updates mean you’re probably backing up new copies of these applications with some frequency. If you find applications that take up a lot of space on your Mac, consider excluding them from your backups.
如果仍然没有足够的空间,则可能要将与游戏相同的逻辑应用于其他大型应用程序。 转到“应用程序”文件夹,然后查找可以轻松重新安装的大型程序。 诸如Microsoft Office和Adobe Creative Suite之类的东西以后很容易重新下载,并且不断的更新意味着您可能会以某种频率备份这些应用程序的新副本。 如果您发现Mac上占用大量空间的应用程序,请考虑将它们从备份中排除。
您可能不需要备份的大文件 (Large Files That You Might Not Need Backed Up)
We’ve shown you how to find your largest files in macOS. Excluding those files might be the simplest way to free up a bit of space on your Time Machine drive. In particular, look for large files you wouldn’t miss or that are easily replaceable. For example, movies that you could re-download are prime candidates for exclusion. If you find multiple such files, stick them in their own folder and then exclude that folder from your backup.
我们已经向您展示了如何在macOS中找到最大的文件。 排除这些文件可能是释放Time Machine驱动器上一点空间的最简单方法。 特别是,寻找不会丢失或易于替换的大文件。 例如,您可以重新下载的电影是排除的主要候选对象。 如果找到多个此类文件,请将它们粘贴在它们自己的文件夹中,然后从备份中排除该文件夹。
您的下载文件夹 (Your Downloads Folder)
If you’re like me, your Downloads folder is a place full of files that you look at briefly before deleting or filing somewhere else. If you want to reduce the size of your regular backups, excluding the Downloads folder is probably a good move—though depending on what you store there, the savings probably aren’t going to be huge. If you have downloads that you want to keep around, our advice is to store those somewhere other than your Downloads folder and then just exclude your Downloads folder.
如果您像我一样,则“下载”文件夹中会放满一些文件,您可以在删除或归档其他位置之前先对其进行简短查看。 如果您想减少常规备份的大小,可以将“下载”文件夹排除在外是个不错的选择-尽管取决于您在其中存储的内容,节省的空间可能不会很大。 如果您有想要保留的下载内容,我们的建议是将这些内容存储在“下载”文件夹之外的其他位置,然后仅排除“下载”文件夹。
极限方法:排除所有系统文件和应用程序 (The Extreme Approach: Exclude All of Your System Files and Applications)
If you’re still running out of space—even after making all the exclusions you feel comfortable with—you might need a bigger hard drive. But you do have one additional (and somewhat extreme) option: excluding all System Files from your backup. To do this, open the Finder and select your computer under the “Devices” category. From there browse to your primary hard drive, then to the “System” folder.
如果您仍然没有足够的空间(即使在进行了所有排除之后仍然感到满意),则可能需要更大的硬盘驱动器。 但是,您确实有一个附加的(并且有些极端)选项:从备份中排除所有系统文件。 为此,请打开Finder,然后在“设备”类别下选择您的计算机。 从那里浏览到您的主硬盘驱动器,然后浏览到“系统”文件夹。
Drag this folder to your list of Time Machine exclusions, and you’ll be asked if you’d like to exclude all of your System Files.
将此文件夹拖到Time Machine排除项列表中,系统会询问您是否要排除所有系统文件。
Doing this means you can’t restore your complete installation from Time Machine. If your hard drive fails, you’ll have to re-install the OS. If you’re willing to put up with that, excluding your system files is another way to save a pretty good amount of space on your backup drive.
这样做意味着您无法从Time Machine恢复完整安装。 如果硬盘驱动器出现故障,则必须重新安装操作系统。 如果您愿意这样做,则排除系统文件是在备份驱动器上节省大量空间的另一种方法。
At the end of the day, it’s your irreplaceable files—photos, videos, documents—that you want to save more than anything else. Everything else can be re-downloaded and re-installed. The easiest recommendation is to just buy a bigger hard drive that lets you back up everything. If you can’t do this, though, excluding certain items from your backup could give you a little more space for the things that matter most.
归根结底,要保存的就是您不可替代的文件(照片,视频,文档)。 其他所有内容都可以重新下载并重新安装。 最简单的建议是购买更大的硬盘驱动器,让您备份所有内容。 但是,如果您无法执行此操作,则从备份中排除某些项目可能会给您更多的空间来处理最重要的事情。
翻译自: https://www.howtogeek.com/294600/save-space-on-your-time-machine-drive-by-excluding-these-folders-from-backups/