File tree Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,9 @@ Preparing the backup
30
30
31
31
.. code-block :: ps1con
32
32
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"
39
34
> 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 "
41
36
42
37
.. group-tab :: macOS
43
38
@@ -149,8 +144,7 @@ Checking the backup
149
144
150
145
.. code-block :: ps1con
151
146
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
154
148
155
149
.. group-tab :: macOS
156
150
Original file line number Diff line number Diff line change @@ -116,7 +116,6 @@ Perform the steps below to restore Wazuh agent files on a Windows endpoint.
116
116
117
117
.. code-block :: ps1con
118
118
119
- > $bkp_folder = "C:\ossec_backup"
120
119
> Copy-Item "$bkp_folder\client.keys" "C:\Program Files (x86)\ossec-agent" -Recurse -Force
121
120
> Copy-Item "$bkp_folder\ossec.conf" "C:\Program Files (x86)\ossec-agent" -Recurse -Force
122
121
> Copy-Item "$bkp_folder\internal_options.conf" "C:\Program Files (x86)\ossec-agent" -Recurse -Force
You can’t perform that action at this time.
0 commit comments