|
|
b2d56b1 |
Name: btrfsmaintenance
|
|
|
b2d56b1 |
Version: 0.5
|
|
|
b2d56b1 |
Release: 1%{?dist}
|
|
|
b2d56b1 |
Summary: Scripts for btrfs maintenance tasks
|
|
|
b2d56b1 |
BuildArch: noarch
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
License: GPLv2+
|
|
|
b2d56b1 |
URL: https://github.com/kdave/btrfsmaintenance
|
|
|
b2d56b1 |
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
BuildRequires: systemd-rpm-macros
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
Requires: btrfs-progs
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
Enhances: btrfs-progs
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
%description
|
|
|
b2d56b1 |
Scripts for btrfs maintenance tasks like periodic scrub, balance, trim or
|
|
|
b2d56b1 |
defrag on selected mountpoints or directories.
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
This is a set of scripts supplementing the btrfs filesystem and aims to
|
|
|
b2d56b1 |
automate a few maintenance tasks. This means the scrub, balance, trim or
|
|
|
b2d56b1 |
defragmentation.
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
Each of the tasks can be turned on/off and configured independently. The
|
|
|
b2d56b1 |
default config values were selected to fit the default installation profile
|
|
|
b2d56b1 |
with btrfs on the root filesystem.
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
Overall tuning of the default values should give a good balance between
|
|
|
b2d56b1 |
effects of the tasks and low impact of other work on the system. If this does
|
|
|
b2d56b1 |
not fit your needs, please adjust the settings.
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
%prep
|
|
|
b2d56b1 |
%autosetup -p1
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
%install
|
|
|
b2d56b1 |
# Scripts
|
|
|
b2d56b1 |
install -Dpm755 btrfs-defrag.sh -t %{buildroot}%{_datadir}/%{name}
|
|
|
b2d56b1 |
install -Dpm755 btrfs-balance.sh -t %{buildroot}%{_datadir}/%{name}
|
|
|
b2d56b1 |
install -Dpm755 btrfs-scrub.sh -t %{buildroot}%{_datadir}/%{name}
|
|
|
b2d56b1 |
install -Dpm755 btrfs-trim.sh -t %{buildroot}%{_datadir}/%{name}
|
|
|
b2d56b1 |
install -Dpm755 %{name}-refresh-cron.sh -t %{buildroot}%{_datadir}/%{name}
|
|
|
b2d56b1 |
install -Dpm755 %{name}-functions -t %{buildroot}%{_datadir}/%{name}
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
# Systemd services and timers
|
|
|
b2d56b1 |
install -Dpm644 %{name}-refresh.service -t %{buildroot}%{_unitdir}
|
|
|
b2d56b1 |
install -Dpm644 %{name}-refresh.path -t %{buildroot}%{_unitdir}
|
|
|
b2d56b1 |
install -Dpm644 btrfs-balance.service -t %{buildroot}%{_unitdir}
|
|
|
b2d56b1 |
install -Dpm644 btrfs-defrag.service -t %{buildroot}%{_unitdir}
|
|
|
b2d56b1 |
install -Dpm644 btrfs-scrub.service -t %{buildroot}%{_unitdir}
|
|
|
b2d56b1 |
install -Dpm644 btrfs-trim.service -t %{buildroot}%{_unitdir}
|
|
|
b2d56b1 |
install -Dpm644 btrfs-balance.timer -t %{buildroot}%{_unitdir}
|
|
|
b2d56b1 |
install -Dpm644 btrfs-defrag.timer -t %{buildroot}%{_unitdir}
|
|
|
b2d56b1 |
install -Dpm644 btrfs-scrub.timer -t %{buildroot}%{_unitdir}
|
|
|
b2d56b1 |
install -Dpm644 btrfs-trim.timer -t %{buildroot}%{_unitdir}
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
# Config
|
|
|
b2d56b1 |
install -Dpm644 sysconfig.%{name} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
%post
|
|
|
b2d56b1 |
%systemd_post %{name}-refresh.service %{name}-refresh.path btrfs-balance.service btrfs-balance.timer btrfs-defrag.service btrfs-defrag.timer btrfs-scrub.service btrfs-scrub.timer btrfs-trim.service btrfs-trim.timer
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
%preun
|
|
|
b2d56b1 |
%systemd_preun %{name}-refresh.service %{name}-refresh.path btrfs-balance.service btrfs-balance.timer btrfs-defrag.service btrfs-defrag.timer btrfs-scrub.service btrfs-scrub.timer btrfs-trim.service btrfs-trim.timer
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
%postun
|
|
|
b2d56b1 |
%systemd_postun_with_restart %{name}-refresh.service %{name}-refresh.path btrfs-balance.service btrfs-balance.timer btrfs-defrag.service btrfs-defrag.timer btrfs-scrub.service btrfs-scrub.timer btrfs-trim.service btrfs-trim.timer
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
%files
|
|
|
b2d56b1 |
%license COPYING
|
|
|
b2d56b1 |
%doc README.md
|
|
|
b2d56b1 |
%{_datadir}/%{name}/
|
|
|
b2d56b1 |
%{_unitdir}/%{name}-refresh.path
|
|
|
b2d56b1 |
%{_unitdir}/%{name}-refresh.service
|
|
|
b2d56b1 |
%{_unitdir}/btrfs-balance.service
|
|
|
b2d56b1 |
%{_unitdir}/btrfs-balance.timer
|
|
|
b2d56b1 |
%{_unitdir}/btrfs-defrag.service
|
|
|
b2d56b1 |
%{_unitdir}/btrfs-defrag.timer
|
|
|
b2d56b1 |
%{_unitdir}/btrfs-scrub.service
|
|
|
b2d56b1 |
%{_unitdir}/btrfs-scrub.timer
|
|
|
b2d56b1 |
%{_unitdir}/btrfs-trim.service
|
|
|
b2d56b1 |
%{_unitdir}/btrfs-trim.timer
|
|
|
b2d56b1 |
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
|
|
|
b2d56b1 |
%changelog
|
|
|
b2d56b1 |
* Thu Oct 29 12:46:07 EET 2020 Artem Polishchuk <ego.cordatus@gmail.com> - 0.5-1
|
|
|
b2d56b1 |
- Initial package
|