If you value your datawhether its some perfect photos you took last weekend, your entire music collection on iTunes, or your draft of the next great American novelyou must stay on top of regular system backup. One of the easiest ways of doing so is to use OS Xs built-in backup program, Time Machine. Time Machine works with your Mac and an external drive to save important documents, photos, and system files regularly. Apart from keeping spares of every file, Time Machine maintains a record of how your system looked on any given day, so you can easily put everything back the way it was if something goes wrong.

OS X has included Time Machine since OS X 10.5 (Leopard). Heres how to get set up in OS X 10.8 (Mountain Lion) using an external drive. For more tips on backing up your data, see "Backup basics" and "Bulletproof backups."

Step 1: Select an external drive

To ensure that you have room for multiple versions of files, select an external drive that's at least two times bigger than your Macs hard drive. To determine how large your Macs hard drive is, select it in the Finder and press Command-I. If your drive capacity is 999GB, for example, youll be best off with a backup drive thats 2TB or larger.

The best type of backup drive to use depends on the type of Mac you have. If you have a Mac with Thunderbolt, select a drive thats Thunderbolt-ready, to take advantage of its speed. The options for Macs without Thunderbolt are FireWire- and USB-compatible drives. Though USB 3.0 and FireWire provide equivalent performance, Apples latest MacBook Pro release lacks a FireWire port, which suggests that Apple may be phasing FireWire out of its designs. Consequently, a USB 3.0 drive may remain compatible with future Macs longer.

Step 2: Prepare your external drive

Once you have an external drive, confirm that its properly formatted for the Mac. If in doubt, connect the hard drive to your Mac and open OS Xs Disk Utility (in the /Applications/Utilities folder). In the left-hand column of the Disk Utility window, select the disk that you want to designate as your Time Machine backup. At the bottom of the window, youll see information about it. If the disks Format reads 'Mac OS Extended (Journaled)', youre good to go.

If not, you'll have to reformat the drive: Click the Erase tab, choose Mac OS Extended (Journaled) from the Format pop-up menu, and click Erase.

For more information, see "How to format a hard drive."

Step 3: Get set up for your first backup

If you already know that your hard drive is compatible, just hook it up. Your Mac will recognize the added hardware, and a window will appear, asking you whether you want to use the drive to back up with Time Machine. Click Use as Backup Disk. A full system backup will begin immediately.

If you dont see this dialog box automatically, or if youve just reformatted your drive, click the System Preferences icon in the Dock (or select Apple menu > System Preferences). Click Time Machine and then click Select Disk. Your external drive should appear in the list. Select the disk and click Use Disk. Time Machine will begin a full system backup.

Your first full system backup will take a few hours or more, depending on the size of your Macs hard drive. But subsequent regular backups will take only a fraction of that time because the drive will  limit itself to updating whats already there and saving new files. If your drive stays connected to your Mac, the scheduled hourly backups will take just seconds to complete.

By default, youll now see a Time Machine icon in your menu bar; it looks like a clock encircled by an arrow running counterclockwise. Click this icon to get quick access to information about your last backup and to the Time Machine preferences panel. If you dont like it, you can prevent this icon from appearing by going to the preferences panel and unchecking the Show Time Machine in menu bar option.

Step 4: Configure and customize your backups

You can tweak several settings to optimize your Time Machine backups.

Exclude items you dont need: If you dont need to save some itemsrestaurant takeout menus in your Downloads folder, for example, or miscellaneous screenshots that live on your Desktopyou can select items to omit from your system's regular backups. Go to the Time Machine preferences pane and click Options. Then click the plus-sign (+) button under the list labeled Exclude these items from backups. From there, pick and choose the items youd like to leave out, and click Exclude when you're finished. In the large Exclude list, youll see the folders or individual files that you selected. You can change your mind about these at any time by selecting a file and clicking the minus-sign (-) button.

If you use an external virtual machine, such as VMware Fusion or Parallels Desktop, to run Windows on your Mac, we recommend excluding it from your Time Machine backups. Backing up your virtual machine will quickly fill up your external hard drive, as Time Machine tends to perform a full backup of virtual machines each time instead of running a simple daily update. Several user have also reported instances where Time Machine crashed a VM session when it tried to perform a backup.

Erase older backups without interruption: When your external drive gets full, Time Machine will automatically erase older backups to make room for new ones. The default setting is for the program to notify you when it has deleted an older backup, but if you dont need this information, uncheck the box next to Notify after old backups are deleted in Time Machine's preferences.

Backup on battery power: If youre a MacBook user, you can also choose to back up while using battery power. Go to Time Machine's preferences, click Options, and select the Back up while on battery power option. By default, Time Machine will back up only when your laptop is connected to AC power, to ensure that your MacBook stays powered during the backup process. If the battery drains completely during a backup, the backup wont be complete and may get corrupted.

Step 5: Keep backing up

Regularly using Time Machine to back up your files is the final step. If you have a desktop Mac, leave your external drive plugged inTime Machine will launch automatically and perform backups hourly. You can also manually start a backup by clicking the Time Machine icon in the menu bar and selecting Back Up Now.

If you dont keep your backup drive connected to your Macbecause your system is a laptop and youre using on the goremember to hook it up regularly to protect your data. The Time Machine icon will display an exclamation point when you haven't run a backup for a while. Just as it did when creating your first full system backup, Time Machine will start running as soon as your drive is plugged in.

Editors note: This story was updated on 11/11/2012 for Mountain Lion compatibility.