Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| macos:time_machine_via_terminal [27/06/2019 12:43] – créée Martin | macos:time_machine_via_terminal [27/06/2019 14:28] (Version actuelle) – Martin | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ====== Contrôler TimeMachine via Terminal ====== | ====== Contrôler TimeMachine via Terminal ====== | ||
| - | Time Machine is a great tool for ensuring that your data is safe, and it's pretty [easy to set up and use][1]. But for some users, the basic Time Machine interface isn't enough. As with most of OS X's functions, there is a command-line tool that lets you do many things with Time Machine. Here's how you can use the `tmutil` command to control and tweak Time Machine from Apple' | + | Time Machine is a great tool for ensuring that your data is safe, and it's pretty [[http:// |
| + | |||
| + | ===== Les bases ===== | ||
| + | {{: | ||
| + | Most people won't need to use this command for their backups because the Time Machine interface will suffice. Who will need it? People who want to manage remote Macs or who want to run scripts containing commands for Time Machine. | ||
| + | |||
| + | The basics of the '' | ||
| + | \\ | ||
| + | \\ | ||
| + | For example, to turn Time Machine on or off, you can run these commands: | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | The '' | ||
| + | |||
| + | If you want to run a Time Machine backup right away, on a Mac that either has Time Machine disabled, or, say, just before updating to a new version of OS X, you can run this command: | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | This is the same as choosing _Back Up Now_ from the Time Machine menu in the menu bar at the top of your screen. | ||
| + | |||
| + | And if you ever want to stop a backup, just run this: | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | ===== Save disk space on your laptop ===== | ||
| + | |||
| + | Since your laptop isn't always connected to its backup disk, Time Machine retains "local snapshots," | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | Running this command will also delete any local snapshots. You can turn local snapshots back on by running: | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | If you love delving into the nitty-gritty, | ||
| + | |||
| + | ===== Exclude files and folders ===== | ||
| + | |||
| + | You can exclude certain files and folders from your Time Machine backups from the Time Machine pane in System Preferences. Naturally, you can also do this from the command line, too. Run this command: | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | The part stands for the path to a file or folder. For example, if I want to exclude my Downloads folder from Time Machine backups, I would run the following: | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | |||
| + | |||
| + | The '' | ||
| + | |||
| + | ===== Manage remote backups ===== | ||
| + | |||
| + | If you're managing a remote Mac, such as a server, you may want to change Time Machine settings for that computer. You can start by finding where Time Machine backups are stored. Run this command: | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | You'll see something like this in Terminal: | ||
| + | |||
| + | <code bash> | ||
| + | Kind : Local | ||
| + | Mount Point : /Volumes/TM Backup | ||
| + | ID : B9DAT9A6-0C37-4C39-A2AE-10A3403C97F9</ | ||
| + | |||
| + | To change the destination, | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | In place of , type in the text string returned by the '' | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | Replace '' | ||
| + | |||
| + | ===== Get Time Machine stats ===== | ||
| + | |||
| + | Time Machine saves a lot of backups: one per hour for the past 24 hours; one a day for the past week; and one a week before that. You can get a list of all the backups on your Time Machine disk with this command: | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | This will show the full path of each backup. | ||
| + | |||
| + | If you're curious about how much has changed in your Time Machine backups, there' | ||
| + | |||
| + | <code bash> | ||
| + | |||
| + | Replace '' | ||
| + | |||
| + | For example, when I ran this command on my backups, I saw data like this: | ||
| + | |||
| + | ![][4] | ||
| + | |||
| + | Here's what I saw when I ran the tmutil calculatedrift backup_folder command on my Mac. | ||
| + | |||
| + | Note that this command takes a long time to run, as your Mac has to calculate a lot of information. | ||
| + | |||
| + | The '' | ||
| + | |||
| + | If you love delving into the nitty-gritty, | ||
| + | |||
| + | ** Article via MacWorld : [[http:// | ||