Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Shared on Facebook

Shop at Amazon

Ad

OSXDaily on Facebook

Search time machine

Change the Automatic File Locking Duration in Mac OS X

Apr 26, 2012 - 1 Comment

Change File Lock Duration in Mac OS X

Mac OS X Lion introduced the file locking feature, which causes any files to automatically lock themselves after a period of time to prevent accidental edits from occurring. You’ve probably seen the resulting message lock before, informing you a file has been locked because recent changes haven’t been made. The time it takes for that automatic file locking to take effect can be adjusted:

  1. Open System Preferences from and click on “Time Machine”
  2. Click “Options”
  3. Look for “Lock documents _ after last edit” and click the pull down menu, selecting a new time duration before the file is locked by OS X

2 weeks is the default which I find to be overly aggressive and I choose 1 month instead, but some users may want locking to take effect even quicker and Apple offers the extraordinarily quick “1 day” option for those who want the utmost in protection from accidental edits.

In the same settings panel you can also choose to disable file locking completely just by unchecking the checkbox, though that isn’t recommended for most users.

OS X 10.7.3 Supplemental Update Fixes Problems with Time Machine Backups

Mar 5, 2012 - 8 Comments

OS X 10.7.3 Supplemental Update

Apple has released a supplemental update to Mac OS X 10.7.3 to address a potential issue with restoring from Time Machine backups.

The update can be found from Software Update via the  Apple menu or downloaded directly from Apple. Installing the update does not require a reboot.

Despite being a minor update, it is good maintenance practice to keep Mac OS X software up to date and it’s recommended to download for all OS X Lion users who rely on Time Machine for backing up their Macs.

Change the Time Machine Backup Schedule

Feb 2, 2012 - 5 Comments

Time Machine Every Mac owner should be using Time Machine, it’s by far the easiest and most painless backup solution, running in the background and allowing for easy recovery of files or the entire operating system should something go wrong during an OS X update or otherwise. That said, Time Machine is a bit aggressive, and backs up all changes every hour that a drive is connected or within range, this is great for backup purposes but can be a nuisance when it hogs disk I/O and CPU cycles from other tasks. The easiest way to avoid this is to adjust the backup schedule, and we’ll show you how to do this from the Terminal, or with a super easy to use Preference Pane called TimeMachineScheduler.

Manually Changing Time Machine Backup Schedule

Using the command line and defaults write, you can manually adjust the Time Machine backup schedule. This command belongs on a single line:

sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int 14400

The last number is the time interval in seconds, making hours grouped by 3600 second segments. If you wanted to wait 4 hours between backups, the number would be 14400, and so on. The default setting is one hour, or 3600 seconds, which can be restored with:

sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int 3600

If you don’t like the command line, or if you want more control over when Time Machine runs, your best bet is the free TimeMachineScheduler app for Mac OS X.

Adjust Time Machine Schedule & Interval with TimeMachineScheduler

TimeMachineScheduler works with Mac OS X 10.7 and 10.6, and allows for simple and precise controls over when Time Machine runs. Just as with the defaults write commands, you can adjust the backup interval, but perhaps most useful is the ability to skip backups between scheduled times. Don’t want Time Machine to run during your peak productivity hours of 9am and 2pm? Set the time period to block in the app.

Time Machine Scheduler

TimeMachineScheduler also lets you restrict backups only to a specified network connection and SSID, which is a great touch for those who use Time Capsules or backups over wifi.

Heads up to The Graphic Mac for finding TimeMachineScheduler

Exclude Folders from Time Machine Backups

Jan 27, 2012 - 4 Comments

Exclude from Time Machine

Excluding folders and files from Time Machine backups is very easy and can make a big difference in the size and speed of backups on a Mac:

  • Launch System Preferences and click on “Time Machine”
  • Click on “Options”
  • Drag and drop folders into the ‘Exclude items from backup’ list
  • Click Save and close out of System Preferences

Exclude a folder from Time Machine backups
If you’re averse to dragging and dropping, you can also click the + plus button and manually select items and folders to exclude. Removing items from the exclusion list is a matter of clicking the name and hitting either the Delete key or clicking the minus button in the exclusion window.

Changes will not impact past Time Machine backups, but future backups with Time Machine will acknowledge the exclusion list and prevent those items from being backed up.

It’s generally a good idea to keep a complete backup of a Mac, and if you don’t know what to exclude you probably shouldn’t exclude anything.

Turn Off File Locking in OS X Lion

Jan 24, 2012 - 5 Comments

File locking in Mac OS X

Mac OS X Lion introduced automatic file locking for any file that hasn’t been edited recently. You’ll have noticed this when you try and open an older file and make changes to it, a dialog box asks to duplicate the file or to manually unlock it. This is fine for files that you don’t want to accidentally Auto-Save over, but sometimes it’s just plain annoying.

Disable Automatic File Locking in Mac OS X

  • Open System Preferences, click on “Time Machine” and then click on “Options”
  • Uncheck the box next to “Lock documents [2 weeks] after last edit”

Without file locking enabled, apps that support auto-save will overwrite the existing file. This is best disabled with either some variation of restoring the “Save As” option or an understanding of how to use Duplicate so that you files are not accidentally overwritten.

Turn off file locking in OS X Lion

Stop Spotlight from Indexing Time Machine Backup Volumes & External Drives

Jan 24, 2012 - 4 Comments

Stop Spotlight from Indexing Time Machine Drives

The default behavior for Spotlight is to start indexing any drive as soon as it’s connected to a Mac, a task that can take a very long time with larger volumes. The problem is that for larger external backup drives and Time Machine volumes, you don’t necessarily want it indexed by Spotlight. This is particularly true if the drive gets used on multiple machines, where indexing on each Mac isn’t necessary.

The solution is simple enough, the same method used to exclude something from Spotlight can also be used to stop Spotlight from indexing a Time Machine drive or other external volume:

  1. Connect the volume you want excluded to the Mac, even if Spotlight is currently indexing
  2. Launch “System Preferences” and click on “Spotlight” followed by the ‘Privacy’ tab
  3. Drag the drives icon into the Privacy window

Even if the drive is currently being indexed by Spotlight, this will cease the indexing process and prevent the drive from being reindexed again on that Mac. You’ll have to redo this process on each Mac that the drive is connected to.

If a drive is removed from the privacy list, it will automatically start a rebuild of the Spotlight index for that volume, however.

Stopping Spotlight from Indexing Backups & External Drives from the Command Line

If you’d rather prevent a drive from being indexed from the command line, you can do that with mdutil and the following syntax:

mdutil -i off /Volumes/VolumeName

When the command has executed properly, you’ll see something like this:

$ mdutil -i off /Volumes/MediaCenterMovies
/Volumes/MediaCenterMovies:
Indexing and searching disabled.

Be sure to specify a full volume path, because if you just use / or don’t use proper syntax you could wind up disabling Spotlight systemwide.

Reversing this and reenabling indexing on a per volume basis is just a matter of changing the flag from off to on:

mdutil -i on /Volumes/VolumeName

Again you’ll get a message, this time confirming the path and “Indexing enabled.”

Compare Time Machine Backups and List All Changes Between Backups

Jan 21, 2012 - 2 Comments

Time Machine Mac OS X 10.7 Lion includes a great tool called tmutil that lets you interact with with Time Machine from the command line. It’s a powerful utility that has a ton of options and we’ve used it before to disable local snapshots, but for the purposes here we are going to use it to compare Time Machine backups. Launch the Terminal from /Applications/Utitilities/ and let’s get started.

Compare Latest Time Machine Backup to Macs Current State File by File

The simplest command compares the most recent Time Machine snapshop with what is currently on the Mac:

tmutil compare

The output can be fairly lengthy depending on how long you go between backups and how much data has changed. This is basically using ‘diff’ on the backup and current state, giving you a file by file breakdown of the differences. Files and paths with a + (plus) in front of them indicate it is new, files with a – (minus) in front indicate it has been removed, and a ! (bang) indicates the file has changed.

tmutil compare output

You’ll also see the size each individual difference, and at the end of the commands output you’ll find a summary of total sizes of what has been added, removed, and changed.

If you only want to compare file sizes, use:

tmutil compare -s

Compare Past Time Machine Backup to Current System State

Finally, if you’re wondering how an older backup compares to the current system state, you can specify the path to the old backup:

tmutil compare /Volumes/TimeMachineDriveName/Backups.backupdb/Macintosh\ HD/2011-11-02-129198

Replace “TimeMachineDriveName” with the name of your backup drive, replace “Macintosh HD” with the name of the primary drive, and replace the date on the end with which date you want to compare that is stored within the Time Machine backups directory.

Disable Time Machine Local Backups in Mac OS X Lion

Sep 28, 2011 - 18 Comments

Time Machine local backups

Time Machine in Mac OS X Lion initiates a sometimes useful, sometimes not feature: local backups. Called snapshots, this seems to be kicked off when your primary Mac is a laptop and the Time Machine backup is an external drive, so OS X Lion compensates for the potentially unavailable external disk by keeping an additional backup locally on the Macs primary hard drive. This has its obvious advantages, since you can restore to past Time Machine backups right away from anywhere, but if you’re trying to conserve disk space this can be a real pain.

Note: Time Machine local backups are only stored if you have Time Machine enabled in general.

Disable Time Machine Local Backup Storage

Here’s how to turn off local backups:

  • Launch Terminal from /Applications/Utilities
  • Enter the following command:
  • sudo tmutil disablelocal

  • Enter the admin password when requested to disable local backups

Re-Enable Local Time Machine Backups

Of course this tip would only be half useful if we didn’t show you how to turn this back on. The steps are the same as above, except with the following command entered into the Terminal instead:
sudo tmutil enablelocal

Remember, if you disable this feature you will not have local backups anymore, so if something goes wrong you will be out of luck. It’s important to have regular backups of your data, and so if you’re going to disable this be sure to still use Time Machine, perhaps even initiating a manual backup before you disconnect the drive, in order to preserve a recent copy of your data.

Backup Time Machine to Non-Native Drives & Network Attached Storage

Feb 28, 2011 - 5 Comments

time-machine-backup Using the command line, you can enable a hidden feature in Time Machine that allows you to backup your Mac to a non-native Networked Attached Storage device or even Windows PC.

Warning: this is an unsupported feature in Mac OS X and Time Machine, relying on this method to backup your data could be risky. Proceed at your own risk.

To get non-native drive support, launch the Terminal and enter the following command:

sudo defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

Now you’ll be able to access non-native NAS volumes through Time Machine setup.

Don’t forget that this is an unsupported feature in Time Machine which is why it isn’t enabled by default, relying on this for your backups may not be the best idea. Apple probably chose to keep it unsupported for several reasons, but remember there’s always a potential for packet loss with network traffic, particularly wireless networks. Packet loss in the case of a backup could result in corrupted or missing data, so if you plan on using this feature you may want to stay on a wired ethernet network to reduce the chances of any transmission loss.

I tried this briefly and got the “Time Machine backup delayed” message, forcing a manual backup to resolve the error. It’s my strong recommendation that you’ll just backup Time Machine to a dedicated backup drive that is physically connected to your Mac, this is without a doubt the most reliable method. Nonetheless, if you’re in a pinch, it’s nice to know you can bend the rules if a situation requires it.

Thanks to Nick for sending this in!

Use Time Machine to backup to a networked Windows or Linux drive

Nov 10, 2010 - 3 Comments

time machine windows Time Machine is a very convenient backup solution for Mac users, but typically requires an external drive to backup to. If you’ve got a network with an extra Windows or Linux PC hanging around with tons of disk space, you can get Time Machine to backup to that computers excess disk space instead of an external drive hooked to your Mac.

If you follow the guide to finish, your Mac will automatically look for and mount a Windows or Linux shared drive and then back up to it using Time Machine. Check out the walkthrough on LifeHacker.

This is a great tip for anyone with a few PC’s hanging around.