Skip to content

Use df with POSIX output format in frespace.sh scripts - #8

Open
code42gab wants to merge 1 commit into
autobrr:mainfrom
code42gab:patch-1
Open

Use df with POSIX output format in frespace.sh scripts#8
code42gab wants to merge 1 commit into
autobrr:mainfrom
code42gab:patch-1

Conversation

@code42gab

Copy link
Copy Markdown

This prevents errors when checking for free space on network mounted disks. For example with a nfs drive mounted at /data/media df will create a multi line output by default:

df /data/media
10.10.10.1:/mnt/usb-drives/data/media
		 5813121024 4991092736 528989184  90% /data/media

This messes up the value extraction via awk, resulting in the script not stopping downloads, instead it just outputs:

not sh: 90%: bad number
got space
free 90%

The -P option forces single line output, which fixes the issue

This prevents errors when checking for free space on network mounted
disks. For example with a nfs drive mounted at `/data/media` `df` will
create a multi line output by default:

```bash
df /data/media
10.10.10.1:/mnt/usb-drives/data/media
		 5813121024 4991092736 528989184  90% /data/media
```

This messes up the value extraction via awk, resulting in the script not
stopping downloads, instead it just outputs:

```bash
not sh: 90%: bad number
got space
free 90%
```

The -P option forces single line output, which fixes the issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant