Skip to content

Commit

Permalink
added section about logging to file
Browse files Browse the repository at this point in the history
  • Loading branch information
markusressel committed Mar 29, 2022
1 parent d62e6e0 commit 9a5788a
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Dependencies:

You can print a help message by running the script without any parameters:

```
```shell
./zfs-inplace-rebalancing.sh
```

Expand All @@ -102,17 +102,29 @@ You can print a help message by running the script without any parameters:
Make sure to run this script with a user that has rw permission to all of the files in the target directory.
The easiest way to achieve this is by **running the script as root**.

```
```shell
sudo su
./zfs-inplace-rebalancing.sh --checksum true --passes 1 /pool/path/to/rebalance
```

To keep track of the balancing progress, you can open another terminal and run:

```
```shell
watch zpool list -v
```

### Log to File

To write the output to a file, simply redirect stdout and stderr to a file (or separate files).
Since this redirects all output, you will have to follow the contents of the log files to get realtime info:

```shell
# one shell window:
tail -F ./stdout.log
# another shell window:
./zfs-inplace-rebalancing.sh /pool/path/to/rebalance >> ./stdout.log 2>> ./stderr.log
```

### Things to consider

Although this script **does** have a progress output (files as well as percentage) it might be a good idea to try a small subfolder first, or process your pool folder layout in manually selected badges. This can also limit the damage done, if anything bad happens.
Expand Down

0 comments on commit 9a5788a

Please sign in to comment.