Skip to content

Commit b23a382

Browse files
committed
Update the Backup guide
1 parent b97edac commit b23a382

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

source/migration-guide/creating/wazuh-agent.rst

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,9 @@ Preparing the backup
3030

3131
.. code-block:: ps1con
3232
33-
> set datetime=%date%-%time%
34-
> set datetime=%datetime: =_%
35-
> set datetime=%datetime:/=-%
36-
> set datetime=%datetime::=_%
37-
> set datetime=%datetime:.=_%
38-
> set bkp_folder=%userprofile%\wazuh_files_backup\%datetime%
33+
> $timestamp = Get-Date -Format "yyyy-MM-dd_HH-mm-ss"
3934
> mkdir %bkp_folder% ; echo %bkp_folder%
40-
> $bkp_folder = "C:\ossec_backup"
35+
> $bkp_folder = Join-Path -Path $env:USERPROFILE -ChildPath "wazuh_files_backup\$timestamp"
4136
4237
.. group-tab:: macOS
4338

@@ -149,8 +144,7 @@ Checking the backup
149144

150145
.. code-block:: ps1con
151146
152-
> cd C:\
153-
> tree ossec_backup /f
147+
> tree (Get-ChildItem "$env:USERPROFILE\wazuh_files_backup" -Directory | Sort-Object LastWriteTime -Descending | Select-Object -First 1 -ExpandProperty FullName) /f
154148
155149
.. group-tab:: macOS
156150

source/migration-guide/restoring/wazuh-agent.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ Perform the steps below to restore Wazuh agent files on a Windows endpoint.
116116

117117
.. code-block:: ps1con
118118
119-
> $bkp_folder = "C:\ossec_backup"
120119
> Copy-Item "$bkp_folder\client.keys" "C:\Program Files (x86)\ossec-agent" -Recurse -Force
121120
> Copy-Item "$bkp_folder\ossec.conf" "C:\Program Files (x86)\ossec-agent" -Recurse -Force
122121
> Copy-Item "$bkp_folder\internal_options.conf" "C:\Program Files (x86)\ossec-agent" -Recurse -Force

0 commit comments

Comments
 (0)