]>
Commit | Line | Data |
---|---|---|
04e24b14 DW |
1 | Maintenance Tasks |
2 | ================= | |
3 | ||
3896f80c | 4 | .. _maintenance_pruning: |
cc4a9d25 | 5 | |
3896f80c TL |
6 | Pruning |
7 | ------- | |
8 | ||
9 | Prune lets you specify which backup snapshots you want to keep. The | |
10 | following retention options are available: | |
11 | ||
12 | ``keep-last <N>`` | |
13 | Keep the last ``<N>`` backup snapshots. | |
14 | ||
15 | ``keep-hourly <N>`` | |
16 | Keep backups for the last ``<N>`` hours. If there is more than one | |
17 | backup for a single hour, only the latest is kept. | |
18 | ||
19 | ``keep-daily <N>`` | |
20 | Keep backups for the last ``<N>`` days. If there is more than one | |
21 | backup for a single day, only the latest is kept. | |
22 | ||
23 | ``keep-weekly <N>`` | |
24 | Keep backups for the last ``<N>`` weeks. If there is more than one | |
25 | backup for a single week, only the latest is kept. | |
26 | ||
27 | .. note:: Weeks start on Monday and end on Sunday. The software | |
28 | uses the `ISO week date`_ system and handles weeks at | |
29 | the end of the year correctly. | |
30 | ||
31 | ``keep-monthly <N>`` | |
32 | Keep backups for the last ``<N>`` months. If there is more than one | |
33 | backup for a single month, only the latest is kept. | |
34 | ||
35 | ``keep-yearly <N>`` | |
36 | Keep backups for the last ``<N>`` years. If there is more than one | |
37 | backup for a single year, only the latest is kept. | |
38 | ||
39 | The retention options are processed in the order given above. Each option | |
40 | only covers backups within its time period. The next option does not take care | |
41 | of already covered backups. It will only consider older backups. | |
42 | ||
43 | Unfinished and incomplete backups will be removed by the prune command unless | |
44 | they are newer than the last successful backup. In this case, the last failed | |
45 | backup is retained. | |
46 | ||
47 | Prune Simulator | |
48 | ^^^^^^^^^^^^^^^ | |
49 | ||
50 | You can use the built-in `prune simulator <prune-simulator/index.html>`_ | |
51 | to explore the effect of different retetion options with various backup | |
52 | schedules. | |
53 | ||
54 | Manual Pruning | |
55 | ^^^^^^^^^^^^^^ | |
56 | ||
57 | .. image:: images/screenshots/pbs-gui-datastore-content-prune-group.png | |
58 | :target: _images/pbs-gui-datastore-content-prune-group.png | |
59 | :align: right | |
60 | :alt: Prune and garbage collection options | |
61 | ||
62 | To access pruning functionality for a specific backup group, you can use the | |
63 | prune command line option discussed in :ref:`backup-pruning`, or navigate to | |
64 | the **Content** tab of the datastore and click the scissors icon in the | |
65 | **Actions** column of the relevant backup group. | |
66 | ||
67 | Prune Schedules | |
68 | ^^^^^^^^^^^^^^^ | |
69 | ||
70 | To prune on a datastore level, scheduling options can be found under the | |
71 | **Prune & GC** tab of the datastore. Here you can set retention settings and | |
72 | edit the interval at which pruning takes place. | |
cc4a9d25 DW |
73 | |
74 | .. image:: images/screenshots/pbs-gui-datastore-prunegc.png | |
3896f80c | 75 | :target: _images/pbs-gui-datastore-prunegc.png |
cc4a9d25 DW |
76 | :align: right |
77 | :alt: Prune and garbage collection options | |
04e24b14 | 78 | |
291b7860 TL |
79 | |
80 | Retention Settings Example | |
81 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
82 | ||
83 | The backup frequency and retention of old backups may depend on how often data | |
84 | changes, and how important an older state may be, in a specific work load. | |
85 | When backups act as a company's document archive, there may also be legal | |
86 | requirements for how long backup snapshots must be kept. | |
87 | ||
88 | For this example, we assume that you are doing daily backups, have a retention | |
89 | period of 10 years, and the period between backups stored gradually grows. | |
90 | ||
91 | - **keep-last:** ``3`` - even if only daily backups, an admin may want to create | |
92 | an extra one just before or after a big upgrade. Setting keep-last ensures | |
93 | this. | |
94 | ||
95 | - **keep-hourly:** not set - for daily backups this is not relevant. You cover | |
96 | extra manual backups already, with keep-last. | |
97 | ||
98 | - **keep-daily:** ``13`` - together with keep-last, which covers at least one | |
99 | day, this ensures that you have at least two weeks of backups. | |
100 | ||
101 | - **keep-weekly:** ``8`` - ensures that you have at least two full months of | |
102 | weekly backups. | |
103 | ||
104 | - **keep-monthly:** ``11`` - together with the previous keep settings, this | |
105 | ensures that you have at least a year of monthly backups. | |
106 | ||
107 | - **keep-yearly:** ``9`` - this is for the long term archive. As you covered the | |
108 | current year with the previous options, you would set this to nine for the | |
109 | remaining ones, giving you a total of at least 10 years of coverage. | |
110 | ||
111 | We recommend that you use a higher retention period than is minimally required | |
112 | by your environment; you can always reduce it if you find it is unnecessarily | |
113 | high, but you cannot recreate backup snapshots from the past. | |
0a0ba078 | 114 | |
3896f80c TL |
115 | |
116 | .. _maintenance_gc: | |
117 | ||
118 | Garbage Collection | |
119 | ------------------ | |
120 | ||
a98e2287 | 121 | You can monitor and run :ref:`garbage collection <client_garbage-collection>` on the |
04e24b14 | 122 | Proxmox Backup Server using the ``garbage-collection`` subcommand of |
cc4a9d25 DW |
123 | ``proxmox-backup-manager``. You can use the ``start`` subcommand to manually |
124 | start garbage collection on an entire datastore and the ``status`` subcommand to | |
a98e2287 | 125 | see attributes relating to the :ref:`garbage collection <client_garbage-collection>`. |
cc4a9d25 DW |
126 | |
127 | This functionality can also be accessed in the GUI, by navigating to **Prune & | |
128 | GC** from the top panel. From here, you can edit the schedule at which garbage | |
129 | collection runs and manually start the operation. | |
130 | ||
131 | ||
710f787c | 132 | .. _maintenance_verification: |
cc4a9d25 DW |
133 | |
134 | Verification | |
135 | ------------ | |
136 | ||
137 | .. image:: images/screenshots/pbs-gui-datastore-verifyjob-add.png | |
3896f80c | 138 | :target: _images/pbs-gui-datastore-verifyjob-add.png |
cc4a9d25 DW |
139 | :align: right |
140 | :alt: Adding a verify job | |
141 | ||
142 | Proxmox Backup offers various verification options to ensure that backup data is | |
143 | intact. Verification is generally carried out through the creation of verify | |
144 | jobs. These are scheduled tasks that run verification at a given interval (see | |
a98e2287 | 145 | :ref:`calendar-event-scheduling`). With these, you can set whether already verified |
cc4a9d25 DW |
146 | snapshots are ignored, as well as set a time period, after which verified jobs |
147 | are checked again. The interface for creating verify jobs can be found under the | |
148 | **Verify Jobs** tab of the datastore. | |
149 | ||
150 | .. Note:: It is recommended that you reverify all backups at least monthly, even | |
151 | if a previous verification was successful. This is becuase physical drives | |
152 | are susceptible to damage over time, which can cause an old, working backup | |
153 | to become corrupted in a process known as `bit rot/data degradation | |
154 | <https://en.wikipedia.org/wiki/Data_degradation>`_. It is good practice to | |
155 | have a regularly recurring (hourly/daily) verification job, which checks new | |
156 | and expired backups, then another weekly/monthly job that will reverify | |
157 | everything. This way, there will be no surprises when it comes to restoring | |
158 | data. | |
04e24b14 | 159 | |
cc4a9d25 DW |
160 | Aside from using verify jobs, you can also run verification manually on entire |
161 | datastores, backup groups, or snapshots. To do this, navigate to the **Content** | |
162 | tab of the datastore and either click *Verify All*, or select the *V.* icon from | |
163 | the *Actions* column in the table. | |
10db4717 TL |
164 | |
165 | .. _maintenance_notification: | |
166 | ||
167 | Notifications | |
168 | ------------- | |
169 | ||
170 | Proxmox Backup Server can send you notification emails about automatically | |
171 | scheduled verification, garbage-collection and synchronization tasks results. | |
172 | ||
173 | By default, notifications are send to the email address configured for the | |
174 | `root@pam` user. You can set that user for each datastore. | |
175 | ||
176 | You can also change the level of notification received per task type, the | |
177 | following options are available: | |
178 | ||
179 | * Always: send a notification for any scheduled task, independent of the | |
180 | outcome | |
181 | ||
182 | * Errors: send a notification for any scheduled task resulting in an error | |
183 | ||
184 | * Never: do not send any notification at all |