On 2016-07-11 03:26, Tomasz Torcz wrote:
On Tue, Jun 21, 2016 at 11:16:59AM -0400, Austin S. Hemmelgarn wrote:
Currently, balance operations are run synchronously in the foreground.
This is nice for interactive management, but is kind of crappy when you
start looking at automation and similar things.
It can be done with simplest systemd unit file:
btrfs-balance@.service:
---
[Unit]
Description=btrfs balance for %I
[Service]
ExecStart=/usr/bin/btrfs balance start %I
ExecStop=/usr/bin/btrfs balance cancel %I
---
It automates quite nicely and needs no additional code.
It's also entirely dependent on a couple of things:
1. You're running systemd (not everyone is, I'm certainly not).
2. You're only dealing with the local system.
The type of situation I'm thinking of is dealing with non-local systems.
For example, running something like this:
ssh user@remotehost btrfs balance start --background /
Keeping the SSH connection open for the duration of the balance has
issues for some people (may close without keep-alive set, uses network
bandwidth with keep-alive set, many people who are hosted have bandwidth
quotas still), and it's extremely useful to have the option to fire and
forget.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html