-
-
Save mozlima/678235fed835cc9570ba03283c120bcc to your computer and use it in GitHub Desktop.
SystemD service and timer templates for duperemove.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
# Usage: systemctl enable --now duperemove-weekly@$(systemd-escape <path>).timer | |
# Utilize %J specifier for duration set. | |
# One can hardlink/copy with 'weekly' part changed | |
# to set other duration. | |
Description=Deduplicate %I at calendar event (%J) | |
After=local-fs.target | |
Requires=local-fs.target | |
Conflicts=shutdown.target rescue.target rescue.service emergency.service | |
[Timer] | |
Unit=duperemove@%i.service | |
RandomizedDelaySec=30 | |
Persistent=true | |
OnCalendar=%J | |
[Install] | |
WantedBy=multi-user.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Recursive deduplication at %I | |
Documentation=man:duperemove(8) | |
Documentation=https://github.com/markfasheh/duperemove.git | |
Conflicts=shutdown.target rescue.target rescue.service emergency.service | |
After=local-fs.target | |
Before=shutdown.target | |
[Service] | |
Type=simple | |
Environment="HashDir=/var/lib/%p" | |
EnvironmentFile=-/etc/default/%p | |
MemoryHigh=1G | |
IOWeight=25 | |
CPUWeight=25 | |
ExecStartPre=/bin/mkdir -p ${HashDir} | |
ExecStartPre=-/bin/df -h %I | |
ExecStart=/usr/bin/duperemove --hashfile=${HashDir}/%i.hashfile -r -d -h $OPTIONS %I | |
ExecStopPost=-/bin/df -h %I |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dir to store hash files. Each instance has own, named by $(systemd-escape <instance>).hashfile | |
#HashDir=/var/lib/duperemove | |
# Additional options for duperemove binary | |
#OPTIONS="" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment