Skip to content

Commit 00ae807

Browse files
authored
Updates from Acrolinx suggestions
1 parent 6633bf5 commit 00ae807

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

articles/azure-netapp-files/azacsnap-cmd-ref-runbefore-runafter.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ This article provides a guide for using the `--runbefore` and `--runafter` capab
1717

1818
AzAcSnap can execute external commands before or after its main execution using the options `--runbefore` or `--runafter` respectively.
1919

20-
`--runbefore` will run a shell command before the main execution of azacsnap and provides some of the azacsnap command-line parameters to the shell environment.
21-
By default, `azacsnap` will wait up to 30 seconds for the external shell command to complete before killing the process and returning to azacsnap normal execution.
20+
`--runbefore` runs a shell command before the main execution of azacsnap and provides some of the azacsnap command-line parameters to the shell environment.
21+
By default, `azacsnap` waits up to 30 seconds for the external shell command to complete before killing the process and returning to azacsnap normal execution.
2222
This delay can be overridden by adding a number to wait in seconds after a `%` character (for example, `--runbefore "mycommand.sh%60"` will wait up to 60 seconds for `mycommand.sh`
2323
to complete).
2424

25-
`--runafter` will run a shell command after the main execution of azacsnap and provides some of the azacsnap command-line parameters to the shell environment.
26-
By default, `azacsnap` will wait up to 30 seconds for the external shell command to complete before killing the process and returning to azacsnap normal execution.
27-
This can be overridden by adding a number to wait in seconds after a `%` character (for example, `--runafter "mycommand.sh%60"` will wait for up to 60 seconds for `mycommand.sh`
25+
`--runafter` runs a shell command after the main execution of azacsnap and provides some of the azacsnap command-line parameters to the shell environment.
26+
By default, `azacsnap` waits up to 30 seconds for the external shell command to complete before killing the process and returning to azacsnap normal execution.
27+
This delay can be overridden by adding a number to wait in seconds after a `%` character (for example, `--runafter "mycommand.sh%60"` will wait for up to 60 seconds for `mycommand.sh`
2828
to complete).
2929

30-
The following list of environment variables is generated by `azacsnap` and passed to the shell forked to run the commands provided as parameters to `--runbefore` and `--runafter`:
30+
`azacsnap` generates the following list of environment variables and passes them to the shell forked to run the commands provided as parameters to `--runbefore` and `--runafter`:
3131

3232
- `$azCommand` = the command option passed to -c (for example, backup, test, etc.).
3333
- `$azConfigFileName` = the configuration filename.
@@ -39,27 +39,27 @@ The following list of environment variables is generated by `azacsnap` and passe
3939
> [!NOTE]
4040
> There's only a value for `$azSnapshotName` in the `--runafter` option.
4141
42-
### Example usage to backup to Azure Blob storage
42+
### Example usage to back up to Azure Blob storage
4343

4444
> [!IMPORTANT]
4545
> Examples are provided for informational purposes only.
46-
> We do not guarantee the accuracy, completeness, or usefulness of any information provided.
46+
> We don't guarantee the accuracy, completeness, or usefulness of any information provided.
4747
> The use of these examples is at your own risk.
48-
> We do not accept any liability for any loss or damage that may arise from the use of these examples.
49-
> We do not offer support for the examples provided in this documentation.
48+
> We don't accept any liability for any loss or damage that may arise from the use of these examples.
49+
> We don't offer support for the examples provided in this documentation.
5050
51-
An example usage for this new feature is to upload a snapshot to Azure Blob for archival purposes using the azcopy tool
51+
An example usage for this new feature is to upload a snapshot to Azure Blob for archival purposes using the `azcopy` tool
5252
([Copy or move data to Azure Storage by using AzCopy](../storage/common/storage-use-azcopy-v10.md)).
5353

5454
#### Shell script to upload to Azure Blob storage
5555

56-
This example shell script has a special stanza at the end to prevent AzAcSnap from killing the external command due to the timeout described earlier. This allows for
56+
This example shell script has a special stanza at the end to prevent AzAcSnap from killing the external command due to the time-out described earlier. This stanza allows for
5757
a long running command, such as uploading large files with azcopy, to be run without being prematurely stopped.
5858

59-
The snapshots need to be mounted on the system doing the copy, with at a minimum read-only privilege. The base location of the mount point for the snapshots should
59+
The snapshots need to be mounted on the system doing the copy, with at a minimum read-only privilege. The base location of the mount point for the snapshots should
6060
be provided to the `sourceDir` variable in the script.
6161

62-
The snapshot is uploaded as a single file by using the `tar` command to create a gzipped tarball. This is done to keep the file permissions and ownership as uploading the files individually will lose these attributes.
62+
The snapshot is uploaded as a single file by using the `tar` command to create a gzipped tarball. Putting the files into a single tarball keeps the file permissions and ownership, otherwise uploading the files individually loses these attributes.
6363

6464
```bash
6565
cat snapshot-to-blob.sh
@@ -246,7 +246,7 @@ PORTAL_GENERATED_SAS="https://<targetstorageaccount>.blob.core.windows.net/<blob
246246

247247
#### Scheduling the shell script
248248

249-
The following crontab entry is a single line and runs `azacsnap` at five past midnight. Note the call to `snapshot-to-blob.sh` passing the
249+
The following crontab entry is a single line and runs `azacsnap` at 12:05am. Note the call to `snapshot-to-blob.sh` passing the
250250
snapshot name and snapshot prefix:
251251

252252
```output
@@ -257,14 +257,14 @@ snapshot name and snapshot prefix:
257257

258258
Restoring from one of these archives stored in Azure Blob storage at a high-level is as follows:
259259

260-
1. Copy the snapshot archive back to the local machine into an area separate from the database files but with enough capacity to allow for the file archive and the extraction (e.g., /var/tmp).
260+
1. Copy the snapshot archive back to the local machine. The target location should be separate from the database files and with enough capacity to allow for the file archive and the extraction, for example `/var/tmp`.
261261
1. If they created the archive using the `--runafter` example shell script, then they can possibly extract the gzipped tarball directly from Azure Blob storage into the target location using an AzCopy pipe to tar to extract, for example:
262262
1. `cd ${TARGET_DIRECTORY}`
263263
1. `azcopy cp "${BLOB_STORE}/${ARCHIVE_BLOB_TGZ}?${BLOB_SAS_KEY}" --from-to BlobPipe | tar zxvf -`
264264
1. Extract the contents of the snapshot archive.
265265
1. Review the contents of the target location after extracting, comparing file permissions and ownership to the original database files.
266266
1. For example, do `ls -lR`.
267-
1. Shutdown the database server.
267+
1. Shut down the database server processes.
268268
1. Copy the files from the target location restored to in step 1 back to their original location.
269269
1. Proceed with the normal database recovery process.
270270

0 commit comments

Comments
 (0)