From d7f773bab61fb4bb2c2885460edc44aceee18cf8 Mon Sep 17 00:00:00 2001 From: Davide Giacometti <25966642+davidegiacometti@users.noreply.github.com> Date: Tue, 11 Mar 2025 22:11:48 +0100 Subject: [PATCH 1/4] backup settings --- hub/powertoys/hosts-file-editor.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hub/powertoys/hosts-file-editor.md b/hub/powertoys/hosts-file-editor.md index 5ae41781ed..fe1e65ede9 100644 --- a/hub/powertoys/hosts-file-editor.md +++ b/hub/powertoys/hosts-file-editor.md @@ -35,7 +35,8 @@ To filter host file entries, select the filter icon and enter data in either the ## Back up Hosts file -Hosts File Editor creates a backup of the hosts file before editing session. The backup files are located near the hosts file in `%SystemRoot%\System32\drivers\etc` named `hosts_PowerToysBackup_YYYYMMDDHHMMSS` and are deleted after 15 days. +Hosts File Editor creates a backup of the hosts file before editing session. By default backup files are located near the hosts file in `%SystemRoot%\System32\drivers\etc` named `hosts_PowerToysBackup_YYYYMMDDHHMMSS`. +Backups are deleted after 15 days, but the most recent 5 are always kept. This behavior can be configured in the PowerToys Settings. ## Settings @@ -47,6 +48,13 @@ From the Settings menu, the following options can be configured: | Show a warning at startup | Warns that editing hosts can change DNS names resolution. Enabled by default. | | Additional lines position | Default value is **Top**. If **Bottom** is selected, the file header is moved below hosts settings to the bottom. | | Consider loopback addresses as duplicates | Loopback addresses (like 127.0.0.1 and ::1) are considered as duplicates. | +| Encoding | Choose the encoding used to save the hosts file between **UTF8** and **UTF8 with BOM**. | +| Backups hosts file | If enabled, a backup of the hosts file is created when you save for the first time in a session. | +| Location | Specify where backups are created. Default `%SystemRoot%\System32\drivers\etc`. | +| Automatically delete backups | Choose **Never**, **Based on Count** or **Based on age and count**. | +| Backup count | When **Automatically delete backups** is **Based on Count**, determine the number of backups to keep. Older backups will be deleted once the limit is reached. | +| Days | When **Automatically delete backups** is **Based on age and count**, determine the number of days to keep backups. Older backups will be deleted once the limit is reached. An optional count of backups can be configured to always keep a fixed number of backups despite their age. | + ## Troubleshooting From 06fa6ba0048c907dbaa3d9275d5e4b4c68ca3957 Mon Sep 17 00:00:00 2001 From: Davide Giacometti <25966642+davidegiacometti@users.noreply.github.com> Date: Tue, 11 Mar 2025 22:19:30 +0100 Subject: [PATCH 2/4] space --- hub/powertoys/hosts-file-editor.md | 1 - 1 file changed, 1 deletion(-) diff --git a/hub/powertoys/hosts-file-editor.md b/hub/powertoys/hosts-file-editor.md index fe1e65ede9..42006a3527 100644 --- a/hub/powertoys/hosts-file-editor.md +++ b/hub/powertoys/hosts-file-editor.md @@ -55,7 +55,6 @@ From the Settings menu, the following options can be configured: | Backup count | When **Automatically delete backups** is **Based on Count**, determine the number of backups to keep. Older backups will be deleted once the limit is reached. | | Days | When **Automatically delete backups** is **Based on age and count**, determine the number of days to keep backups. Older backups will be deleted once the limit is reached. An optional count of backups can be configured to always keep a fixed number of backups despite their age. | - ## Troubleshooting A "Failed to save hosts file" message appears if a change is made without administrator permissions: From 5af3cd54327f3b5052637ba38a54197f615f91d8 Mon Sep 17 00:00:00 2001 From: Davide Giacometti <25966642+davidegiacometti@users.noreply.github.com> Date: Tue, 11 Mar 2025 22:30:26 +0100 Subject: [PATCH 3/4] typo --- hub/powertoys/hosts-file-editor.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hub/powertoys/hosts-file-editor.md b/hub/powertoys/hosts-file-editor.md index 42006a3527..ca0a8edbfd 100644 --- a/hub/powertoys/hosts-file-editor.md +++ b/hub/powertoys/hosts-file-editor.md @@ -51,8 +51,8 @@ From the Settings menu, the following options can be configured: | Encoding | Choose the encoding used to save the hosts file between **UTF8** and **UTF8 with BOM**. | | Backups hosts file | If enabled, a backup of the hosts file is created when you save for the first time in a session. | | Location | Specify where backups are created. Default `%SystemRoot%\System32\drivers\etc`. | -| Automatically delete backups | Choose **Never**, **Based on Count** or **Based on age and count**. | -| Backup count | When **Automatically delete backups** is **Based on Count**, determine the number of backups to keep. Older backups will be deleted once the limit is reached. | +| Automatically delete backups | Choose **Never**, **Based on count** or **Based on age and count**. | +| Backup count | When **Automatically delete backups** is **Based on count**, determine the number of backups to keep. Older backups will be deleted once the limit is reached. | | Days | When **Automatically delete backups** is **Based on age and count**, determine the number of days to keep backups. Older backups will be deleted once the limit is reached. An optional count of backups can be configured to always keep a fixed number of backups despite their age. | ## Troubleshooting From 5a215443d5c30f99c1ca431dbfc0c2f24348aa48 Mon Sep 17 00:00:00 2001 From: Davide Giacometti <25966642+davidegiacometti@users.noreply.github.com> Date: Wed, 19 Mar 2025 20:44:35 +0100 Subject: [PATCH 4/4] Update hub/powertoys/hosts-file-editor.md Co-authored-by: Alvin Ashcraft <73072+alvinashcraft@users.noreply.github.com> --- hub/powertoys/hosts-file-editor.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hub/powertoys/hosts-file-editor.md b/hub/powertoys/hosts-file-editor.md index ca0a8edbfd..e915263f74 100644 --- a/hub/powertoys/hosts-file-editor.md +++ b/hub/powertoys/hosts-file-editor.md @@ -35,7 +35,8 @@ To filter host file entries, select the filter icon and enter data in either the ## Back up Hosts file -Hosts File Editor creates a backup of the hosts file before editing session. By default backup files are located near the hosts file in `%SystemRoot%\System32\drivers\etc` named `hosts_PowerToysBackup_YYYYMMDDHHMMSS`. +Hosts File Editor creates a backup of the hosts file before editing session. By default backup files are located near the hosts file in `%SystemRoot%\System32\drivers\etc` named `hosts_PowerToysBackup_YYYYMMDDHHMMSS`. + Backups are deleted after 15 days, but the most recent 5 are always kept. This behavior can be configured in the PowerToys Settings. ## Settings