Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
14fb655
feat: add Nix integration
tomeon Sep 6, 2023
18df262
feat(nix): add Nix derivation
tomeon Sep 6, 2023
9003067
feat(nix): add `services.asd` NixOS module
tomeon Sep 6, 2023
b54532d
feat(nix): add NixOS test
tomeon Sep 6, 2023
90be242
fix: use portable shebang
tomeon Sep 6, 2023
59bc5e7
feat: add fancy PS4
tomeon Sep 6, 2023
c8f49b7
refactor: add truthiness-testing function
tomeon Sep 6, 2023
5bc4b27
feat: add logging functions
tomeon Sep 6, 2023
38b4d0c
fix: don't recheck `DEBUG` upon each `debug` call
tomeon Sep 6, 2023
dbab74f
feat: add (?:un)?mounting helper script
tomeon Sep 6, 2023
c1ed2de
feat: enable "strict mode"
tomeon Sep 11, 2023
0237e52
chore: issue message upon ERR but do not bail out
tomeon Sep 11, 2023
b67c2df
chore: consolidate dependency checks
tomeon Sep 11, 2023
3addfde
feat: improve (f)locking logic
tomeon Sep 11, 2023
f17efca
feat: remove asd.conf syntax check
tomeon Sep 11, 2023
4f0ae1e
chore: s/\./source/
tomeon Sep 11, 2023
f0ed7dc
feat: make shellcheck find asd.conf next to asd
tomeon Sep 11, 2023
943dd86
chore: simplify variable assignments
tomeon Sep 11, 2023
fd78ba2
chore: remove unneeded `""` in `debug ""`
tomeon Sep 11, 2023
20b2b2d
chore: s/true/:/
tomeon Sep 11, 2023
a9d2428
fix: handle unset WHATTOSYNC array
tomeon Sep 11, 2023
b0dcca4
fix: suppress errors re-enforcing extglob setting
tomeon Sep 11, 2023
42c5010
fix: handle unset `VOLATILE` variable
tomeon Sep 11, 2023
09dc29d
chore: put "VOLATILE is tmpfs/zram" check in func
tomeon Sep 11, 2023
88d5b30
chore: simplify "can I use OverlayFS?" check
tomeon Sep 11, 2023
086ed9a
feat: more portable "using systemd?" check
tomeon Sep 11, 2023
57effb9
chore: simplify distro check and header definition
tomeon Sep 11, 2023
4155fbf
feat: add function for running cmds verbosely
tomeon Sep 11, 2023
7b19f26
feat: add a for-each-WHATTOSYNC-dir function
tomeon Sep 11, 2023
45c5437
feat: add "running as root?" function
tomeon Sep 11, 2023
122c522
feat: add "do I need/have sudo?" functions
tomeon Sep 11, 2023
8660e02
feat: permit running asd as non-root user
tomeon Sep 11, 2023
42f0666
feat: respect the `NO_COLOR` env var
tomeon Sep 11, 2023
c911632
chore: miscellaneous linting and formatting
tomeon Sep 11, 2023
3961066
fix(init/asd.service): persist RuntimeDirectory
tomeon Sep 11, 2023
007908c
feat: user-settable `ASD{CONF,RUN}DIR` env vars
tomeon Sep 13, 2023
f765c21
fix: restore `ASDCONF` and `VOLATILE` defaults
tomeon Sep 13, 2023
2f131a4
fix(nixos): set `ASDNOV1PATHS=yes`
tomeon Sep 13, 2023
30f3947
fix: stop asd.conf from redefining important vars
tomeon Sep 13, 2023
f3a2d75
chore: ignore `.nixos-test-history`
tomeon Sep 13, 2023
1c82868
docs(asd.conf): note that file is a Bash script
tomeon Sep 13, 2023
04ab680
feat(nix): add user unit NixOS test cases
tomeon Sep 14, 2023
d619142
feat(ci): add NixOS systems tests workflow
tomeon Sep 14, 2023
af22224
feat: enforce timeout sourcing `asd.conf`
tomeon Sep 14, 2023
51b66ca
chore(asd): s/Overlayfs/OverlayFS/g
tomeon Sep 22, 2023
06911aa
docs: add USAGE.md
tomeon Sep 19, 2023
5a89795
docs(USAGE): rework structure and add links
tomeon Sep 22, 2023
033fffb
docs(README): rework structure and add links
tomeon Sep 22, 2023
2984800
feat: build asd manpage from USAGE.md with pandoc
tomeon Sep 19, 2023
83e5952
chore: regenerate manpage
tomeon Sep 22, 2023
fd2318d
fix: check mountpoints in ungraceful state check
tomeon Sep 22, 2023
dee6e6b
chore(asd): move negation outside `[[ ... ]]`
tomeon Sep 26, 2023
19b1835
feat(checks): add ungraceful state subtests
tomeon Sep 26, 2023
34c9465
feat(nix): rework test node into example profile
tomeon Sep 26, 2023
7d11ff5
feat: add `nixos-shell` for running a dev VM
tomeon Sep 26, 2023
073e68e
refactor(asd): add `main` function
tomeon Sep 26, 2023
dcf85cb
fix(nix): rework crash-recovery subtest
tomeon Sep 28, 2023
c33d8e0
refactor: move setup steps into functions
tomeon Sep 28, 2023
f884ac2
feat: obtain lock in-process
tomeon Sep 28, 2023
76c2ad7
fix: check that `WHATTOSYNC` is declared
tomeon Sep 28, 2023
a97d365
feat: support sourcing `anything-sync-daemon`
tomeon Sep 28, 2023
6468ca4
chore: use printf builtin for crash file dates
tomeon Sep 28, 2023
b4cf6e4
chore(ci): remove `shellcheck` workflow
tomeon Sep 28, 2023
582e0f2
refactor: add `run_systemd` function
tomeon Sep 28, 2023
30e4b3e
feat: detect systemd units besides `asd.service`
tomeon Sep 28, 2023
c79bac4
feat: display systemd unit name
tomeon Sep 28, 2023
a80aed3
refactor: use internal-only settings
tomeon Sep 28, 2023
f89d6be
fix: respect `DEBUG` definition from `asd.conf`
tomeon Sep 28, 2023
b49fc81
refactor: add `for_each_dir_with_crasharr` func
tomeon Sep 28, 2023
bf53f5d
docs: add BleachBit link
tomeon Sep 29, 2023
82f543f
docs: describe `DEBUG` variable
tomeon Sep 29, 2023
da37d29
docs: describe significant environment variables
tomeon Sep 29, 2023
60ceeb7
feat(devshell): add gnumake and gzip
tomeon Sep 29, 2023
9403fe1
chore: regenerate man page
tomeon Sep 29, 2023
49fc256
chore: git-ignore generated script
tomeon Sep 29, 2023
ab2e225
feat(Makefile): install systemd user unit files
tomeon Sep 29, 2023
ec5d321
fix(Makefile): install conf directory
tomeon Sep 29, 2023
3041783
fix(Makefile): overwrite compressed manpage
tomeon Sep 29, 2023
5fdb3e6
docs(INSTALL): flesh out prereqs list
tomeon Sep 29, 2023
5eecdf5
fix(INSTALL): correct typos and out-of-date info
tomeon Sep 29, 2023
628cf42
fix(nix): describe `configFile` option
tomeon Sep 29, 2023
1a451d1
feat(nix): add `docs` package
tomeon Sep 29, 2023
f7c93c2
feat(nix): add devshell command to generate docs
tomeon Sep 29, 2023
543b68e
docs: add NixOS module docs
tomeon Sep 29, 2023
e87c40a
feat(nix): add "docs up-to-date?" check
tomeon Sep 29, 2023
afdb722
docs(INSTALL): describe Nix package, NixOS module
tomeon Sep 29, 2023
51eef7e
feat(ci): parallelize jobs
tomeon Sep 29, 2023
56ed032
feat(devshell): install act
tomeon Sep 30, 2023
f460885
fix(ci): empty Nix `build-users-group`
tomeon Sep 30, 2023
1b34fb6
fix(ci): use local flake.nix for building nix conf
tomeon Sep 30, 2023
a282b65
fix(ci): don't cache Nix store in local runs
tomeon Sep 30, 2023
f4dffa8
feat(ci): build NixOS test driver for debugging
tomeon Sep 30, 2023
ef774eb
fix(nix): don't wait for `multi-user.target`
tomeon Sep 30, 2023
bb1cd6b
feat: generic path-cleaning implementation
tomeon Oct 3, 2023
0951084
feat: support shell expansions in whatToSync opt
tomeon Oct 3, 2023
424b786
feat: deduplicate sync targets
tomeon Oct 3, 2023
c7fee38
feat: add debugging output re mount state
tomeon Oct 3, 2023
112a52c
feat: issue warnings upon unexpected mounts
tomeon Oct 3, 2023
c5bee08
feat: add yellow color
tomeon Oct 4, 2023
2551b58
fix: explicitly pass `--list` to `findmnt`
tomeon Oct 4, 2023
baef54f
fix: find only *first* matching mount
tomeon Oct 4, 2023
95e9685
fix: reliably identify canonical bind mount source
tomeon Oct 4, 2023
8c419c9
chore: move `verbosely` to `run_mount_helper`
tomeon Oct 5, 2023
6f7e783
chore: shell-quote commands in `verbosely`
tomeon Oct 5, 2023
7123dfb
chore: use `verbosely` instead of `set -x`
tomeon Oct 5, 2023
cc1daf6
fix: remove symlink-listing tempfile on error
tomeon Oct 5, 2023
af9f946
feat: use NUL separator between symlink names
tomeon Oct 5, 2023
e530936
fix(checks): block until flag file exists
tomeon Oct 5, 2023
92c799a
chore(ci): split checks into "system" and "user"
tomeon Oct 5, 2023
4d6b86b
fix(asd.service): comment out `RuntimeDirectory`
tomeon Oct 6, 2023
ef4e525
feat: add Vagrant configuration
tomeon Oct 6, 2023
8d4a7df
fix: handle > 1 {CONFIGURATION,RUNTIME}_DIRECTORY
tomeon Oct 8, 2023
6086c7d
docs: add changelog
tomeon Oct 8, 2023
ceb7e8f
feat: warn about the use of V1 paths
tomeon Oct 9, 2023
565b3a3
docs: further usage updates and clarifications
tomeon Oct 11, 2023
3551f5a
chore(gitignore): ignore Vagrant state
tomeon Apr 19, 2024
14aa871
doc(treewide): s/symlink/bind-mount/
tomeon Jul 14, 2024
ef319c6
refactor: lib for generators, options, and modules
tomeon Jul 14, 2024
030a0ae
feat(nix): add Home Manager module
tomeon Jul 14, 2024
c003cf9
WIP on Nix installation instructions
tomeon Jul 15, 2024
4b977c9
docs: add myself as a contributor
tomeon Jul 15, 2024
b9664be
fix(nix): add more `asd` prereq packages
tomeon Jul 16, 2024
de1e3a0
docs: document home-manager module
tomeon Jul 21, 2024
f0435de
chore: add `_file` annotations to modules
tomeon Jul 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: NixOS flake checks

on:
push:
pull_request:

jobs:
nix:
runs-on: ubuntu-latest
strategy:
matrix:
system:
- x86_64-linux
check:
- treefmt
- docs
- anything-sync-daemon-system
- anything-sync-daemon-user
- anything-sync-daemon-home-manager
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Nix
uses: nixbuild/nix-quick-install-action@v25
with:
# Empty `build-users-group` definition required in order to test this
# under `act`, at least when using "medium size" images.
nix_conf: |
system-features = benchmark big-parallel kvm nixos-test
keep-derivations = true
keep-outputs = true
build-users-group =
env:
# Don't bother using `gh` to fetch `flake.nix`, as it's (a)
# unnecessary and (b) problematic when running under `act` (`gh`
# bails out, saying that login is required).
# https://github.com/nixbuild/nix-quick-install-action/blob/d96491740839e162d9448daa5446f14dd88a52b2/read-nix-config-from-flake.sh#L17-L29
flake_file: "${{ github.workspace }}/flake.nix"
- name: Restore and cache Nix store
# Don't restore/cache when running locally.
# https://github.com/nektos/act#skipping-steps
if: "${{ !env.ACT }}"
uses: nix-community/cache-nix-action@v4
with:
key: "cache-${{ matrix.system }}-${{ hashFiles('**/*.nix', 'flake.lock') }}"
restore-keys: |
cache-${{ matrix.system }}-
purge-caches: true
purge-created: true
purge-key: "cache-${{ matrix.system }}-"
# Build the test driver for debugging purposes. To run the driver, enter
# the `act` container (`docker exec act-<...> bash`) and execute
# `./driver/bin/nixos-test-driver -I`.
- name: Build NixOS test driver
# Only build when running locally.
# https://github.com/nektos/act#skipping-steps
if: "${{ env.ACT }}"
# Not all checks have a `driver` attribute; ignore errors.
run: "nix build -o driver -L '.#checks.${{ matrix.system }}.${{ matrix.check }}.driver' 2>/dev/null || :"
- name: Run flake check
run: "nix build -L '.#checks.${{ matrix.system }}.${{ matrix.check }}'"
15 changes: 0 additions & 15 deletions .github/workflows/shellcheck.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Script rendered from `common/anything-sync-daemon.in`
common/anything-sync-daemon

# `nix build` and friends' output links
result
result-*
repl-result-*

# From using `nixos-test-driver`
.nixos-test-history

# Disk images from using `nixos-shell`
*.qcow2

# Vagrant state
/.vagrant/
87 changes: 87 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Changelog for `anything-sync-daemon`

All notable changes to this project will be documented in this file.

## [Unreleased]

### Added

- Support running as an unprivileged user.
- Document usage in [a Markdown file](/USAGE.md) readable in GitHub's web UI.
- Document significant environment variables in the manual page.
- Add [a Nix derivation](/nix/packages.nix) for `anything-sync-daemon`.
- Add [NixOS modules](/nix/nixos-modules.nix) for managing
`anything-sync-daemon`.
- Support OverlayFS when running as an unprivileged user by managing mounts
through the new [`asd-mount-helper`](/common/asd-mount-helper) script.
For this to work, the user in question must be able to run `asd-mount-helper`
as root via `sudo` without entering a password.
- Install the example systemd unit files to the `/user/` unit file hierarchy
when executing the `install-systemd` Make target.

### Fixed

- Only unmount bind mounts if they have the expected source, and only unmount
volatile paths if they are OverlayFS mountpoints.
- Ensure that `asd.conf`'s parent directory exists before attempt to copy
`asd.conf` into it.
- Deduplicate sync targets (entries in the `WHATTOSYNC` array). This means
testing for string equality on said targets' canonicalized representations,
as determined by `realpath -m` or `readlink -m`, if those commands are
available and respect the `-m` ("canonicalize missing") option, or otherwise
by a native shell routine that simply removes trailing slashes.
`anything-sync-daemon` issues a non-fatal warning if it detects duplicate
sync targets.
- Ensure that all intended mount points are mounted as expected when performing
the "ungraceful state" check. This means checking that bind mounts exist and
have the expected source (e.g. `/foo/bar/.baz-backup_asd-old` has the source
`/foo/bar/baz`) and that (when `USE_OVERLAYFS` is in effect) overlay mount
targets have the same mount options as their mount sources. This makes it
possible for `asd` to recover from partial mount states -- that is, to
sensibly re-mount intended mount points before performing re-synchronization.
- In the "ungraceful state" check, only unmount intended mountpoints if they
are mounted as expected (in the manner described immediately above). This
means that `asd` is no longer liable to unmount other filesystems that may
happen to be mounted in the relevant locations.
- Install the `asd.conf` parent directory before attempting to copy `asd.conf`
into place.

### Changed

- **BREAKING CHANGE**: Load `asd.conf` in a subprocess. This is a breaking
change for configurations that attempt to inspect or modify the
`anything-sync-daemon` script's internal state.
- **BREAKING CHANGE**: Enforce a timeout of configurable
duration on loading `asd.conf` operation. This is a breaking change for
configurations that do not load within said timeout, though this can be
addressed by specifying a longer timeout in the `ASDCONFTIMEOUT` environment
variable.
- **BREAKING CHANGE**: Use the portable shebang `#!/usr/bin/env bash` rather
than using `#!/bin/bash`. This is a breaking change for any setups that (a)
have a `bash` under an entry in `PATH` that takes precedence over
`/bin/bash`, and (b) are compatible with `/bin/bash` but not the
higher-precedence `bash`. It is also incompatible with setups that lack
`/bin` in `PATH`.
- Respect [the `NO_COLOR` environment variable](https://no-color.org); that is,
do not colorize output if `NO_COLOR` is set to a non-empty value.
- **BREAKING CHANGE**: Attempt to obtain an exclusive lock in-process (via
`flock -n <file-descriptor>`) rather than by re-executing when the `FLOCKER`
environment variable is unset or empty. This breaks setups that bypass
locking by setting `FLOCKER` to a non-empty value.
- **BREAKING CHANGE**: detect the presence of `asd.service` by running
`systemd list-unit-files asd.service`, in addition to checking for the unit
file at `/usr/lib/systemd/system/asd.service` (or, if running `asd` as a
non-root user, `/usr/lib/systemd/user/asd.service`). This makes `asd` liable
to conclude that it is being run under systemd when previously it would have
concluded otherwise.
- **BREAKING CHANGE**: detect the `INVOCATION_ID` environment variable and, if
it is present, determine the name of the corresponding systemd service, if
one exists. If a service is detected, assume that `asd` is running under
systemd. As with the item just above, this makes `asd` liable to conclude
that it is being run under systemd when previously it would have concluded
otherwise.

### Removed

- Removed the `asd.conf` "syntax check". Now, `anything-sync-daemon` accepts
any valid Bash code in `asd.conf`.
28 changes: 22 additions & 6 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
DEPENDENCIES
awk
bash >=4.0
coreutils or busybox
cron (only if using upstart)
find
grep
procps (procps-ng)
pv
rsync
tar
utillinux
zstd

a supported init system
-systemd
Expand All @@ -14,21 +22,22 @@ versions of this software before install updates. Internal changes are
always possible from one release to another.

BUILDING
Setup the via a make.
Setup the script via a make.

$ make

Running a `make install-xxx` as root will distribute the files to the file-
system. Most users will want to select from three options depending on target
init system (do not run both)!
system. Most users will want to select from one or the other of the following
options depending on target init system (do not run both)!

# make install-systemd-all
# make install-upstart-all

As of v3.13, the Makefiles for systemd-native distros such as Arch, Exherbo,
and Fedora, no longer install the deprecated cron script using a systemd
timer instead. Users may override and install the deprecated cron script by
running make with `install-with-cron` instead of `install` at this point.
and Fedora, no longer install the deprecated cron script, and instead install
a systemd timer unit. Users may override and install the deprecated cron
script by running make with `install-with-cron` instead of `install` at this
point.

USE A DISTRO PROVIDED PACKAGE
ARCH LINUX
Expand All @@ -38,3 +47,10 @@ USE A DISTRO PROVIDED PACKAGE
CHAKRA
Chakra users may build the package directly with the provided PKGBUILD:
http://chakraos.org/ccr/packages.php?ID=3750

NIX/NIXOS
anything-sync-daemon provides a Nix flake,
`github:graysky2/anything-sync-daemon`. This flake's outputs include the
`anything-sync-daemon` package (`packages.<system>.anything-sync-daemon`) and
the `anything-sync-daemon` NixOS module (`nixosModules.anything-sync-daemon`).
See `doc/nixos-modules.md` for available options.
34 changes: 25 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ PREFIX ?= /usr
CONFDIR = /etc
CRONDIR = /etc/cron.hourly
INITDIR_SYSTEMD = /usr/lib/systemd/system
INITDIR_SYSTEMD_SYSTEM = $(INITDIR_SYSTEMD)
INITDIR_SYSTEMD_USER = $(dir $(INITDIR_SYSTEMD))/user
INITDIR_UPSTART = /etc/init.d
BINDIR = $(PREFIX)/bin
DOCDIR = $(PREFIX)/share/doc/$(PN)
Expand All @@ -15,6 +17,7 @@ BSHDIR = $(PREFIX)/share/bash-completion/completions
# set to anything except 0 to enable manpage compression
COMPRESS_MAN = 1

PANDOC = pandoc
RM = rm
SED = sed
INSTALL = install -p
Expand All @@ -29,6 +32,9 @@ common/$(PN): Makefile common/$(PN).in
$(Q)echo -e '\033[1;32mSetting version\033[0m'
$(Q)$(SED) 's/@VERSION@/'$(VERSION)'/' common/$(PN).in > common/$(PN)

doc/asd.1: USAGE.md
$(PANDOC) --standalone --from markdown+definition_lists+pandoc_title_block --to man -o $@ $<

help: install

stop-asd:
Expand All @@ -45,19 +51,21 @@ install-bin: stop-asd disable-systemd common/$(PN)
$(Q)echo -e '\033[1;32mInstalling main script...\033[0m'
$(INSTALL_DIR) "$(DESTDIR)$(BINDIR)"
$(INSTALL_PROGRAM) common/$(PN) "$(DESTDIR)$(BINDIR)/$(PN)"
$(INSTALL_PROGRAM) common/asd-mount-helper "$(DESTDIR)$(BINDIR)/asd-mount-helper"
ln -sf $(PN) "$(DESTDIR)$(BINDIR)/asd"
$(INSTALL_DIR) "$(DESTDIR)$(CONFDIR)"
cp -n common/asd.conf "$(DESTDIR)$(CONFDIR)/asd.conf"
$(INSTALL_DIR) "$(DESTDIR)$(ZSHDIR)"
$(INSTALL_DATA) common/zsh-completion "$(DESTDIR)/$(ZSHDIR)/_asd"
$(INSTALL_DIR) "$(DESTDIR)$(BSHDIR)"
$(INSTALL_DATA) common/bash-completion "$(DESTDIR)/$(BSHDIR)/asd"

install-man:
install-man: doc/asd.1
$(Q)echo -e '\033[1;32mInstalling manpage...\033[0m'
$(INSTALL_DIR) "$(DESTDIR)$(MANDIR)"
$(INSTALL_DATA) doc/asd.1 "$(DESTDIR)$(MANDIR)/asd.1"
ifneq ($(COMPRESS_MAN),0)
gzip -9 "$(DESTDIR)$(MANDIR)/asd.1"
gzip -f -9 "$(DESTDIR)$(MANDIR)/asd.1"
ln -sf asd.1.gz "$(DESTDIR)$(MANDIR)/$(PN).1.gz"
else
ln -sf asd.1 "$(DESTDIR)$(MANDIR)/$(PN).1"
Expand All @@ -71,10 +79,14 @@ install-cron:
install-systemd:
$(Q)echo -e '\033[1;32mInstalling systemd files...\033[0m'
$(INSTALL_DIR) "$(DESTDIR)$(CONFDIR)"
$(INSTALL_DIR) "$(DESTDIR)$(INITDIR_SYSTEMD)"
$(INSTALL_DATA) init/asd.service "$(DESTDIR)$(INITDIR_SYSTEMD)/asd.service"
$(INSTALL_DATA) init/asd-resync.service "$(DESTDIR)$(INITDIR_SYSTEMD)/asd-resync.service"
$(INSTALL_DATA) init/asd-resync.timer "$(DESTDIR)$(INITDIR_SYSTEMD)/asd-resync.timer"
$(INSTALL_DIR) "$(DESTDIR)$(INITDIR_SYSTEMD_SYSTEM)"
$(INSTALL_DATA) init/asd.service "$(DESTDIR)$(INITDIR_SYSTEMD_SYSTEM)/asd.service"
$(INSTALL_DATA) init/asd-resync.service "$(DESTDIR)$(INITDIR_SYSTEMD_SYSTEM)/asd-resync.service"
$(INSTALL_DATA) init/asd-resync.timer "$(DESTDIR)$(INITDIR_SYSTEMD_SYSTEM)/asd-resync.timer"
$(INSTALL_DIR) "$(DESTDIR)$(INITDIR_SYSTEMD_USER)"
$(INSTALL_DATA) init/asd.service "$(DESTDIR)$(INITDIR_SYSTEMD_USER)/asd.service"
$(INSTALL_DATA) init/asd-resync.service "$(DESTDIR)$(INITDIR_SYSTEMD_USER)/asd-resync.service"
$(INSTALL_DATA) init/asd-resync.timer "$(DESTDIR)$(INITDIR_SYSTEMD_USER)/asd-resync.timer"

install-upstart:
$(Q)echo -e '\033[1;32mInstalling upstart files...\033[0m'
Expand All @@ -97,6 +109,7 @@ install:
uninstall-bin:
$(RM) "$(DESTDIR)$(BINDIR)/$(PN)"
$(RM) "$(DESTDIR)$(BINDIR)/asd"
$(RM) "$(DESTDIR)/$(BINDIR)/asd-mount-helper"
$(RM) "$(DESTDIR)/$(ZSHDIR)/_asd"
$(RM) "$(DESTDIR)/$(BSHDIR)/asd"

Expand All @@ -111,9 +124,12 @@ uninstall-cron:

uninstall-systemd:
$(RM) "$(DESTDIR)$(CONFDIR)/asd.conf"
$(RM) "$(DESTDIR)$(INITDIR_SYSTEMD)/asd.service"
$(RM) "$(DESTDIR)$(INITDIR_SYSTEMD)/asd-resync.service"
$(RM) "$(DESTDIR)$(INITDIR_SYSTEMD)/asd-resync.timer"
$(RM) "$(DESTDIR)$(INITDIR_SYSTEMD_SYSTEM)/asd.service"
$(RM) "$(DESTDIR)$(INITDIR_SYSTEMD_SYSTEM)/asd-resync.service"
$(RM) "$(DESTDIR)$(INITDIR_SYSTEMD_SYSTEM)/asd-resync.timer"
$(RM) "$(DESTDIR)$(INITDIR_SYSTEMD_USER)/asd.service"
$(RM) "$(DESTDIR)$(INITDIR_SYSTEMD_USER)/asd-resync.service"
$(RM) "$(DESTDIR)$(INITDIR_SYSTEMD_USER)/asd-resync.timer"

uninstall-upstart:
$(RM) "$(DESTDIR)$(CONFDIR)/asd.conf"
Expand Down
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
# Anything-sync-daemon
Anything-sync-daemon (asd) is a tiny pseudo-daemon designed to manage user defined dirs in tmpfs and to periodically sync back to the physical disc (HDD/SSD). This is accomplished via a symlinking step and an innovative use of rsync to maintain back-up and synchronization between the two. One of the major design goals of asd is a completely transparent user experience.

Anything-sync-daemon (asd) is a tiny pseudo-daemon designed to manage user
defined dirs in tmpfs and to periodically sync back to the physical disc
(HDD/SSD). This is accomplished via a bind-mounting step and an innovative use
of rsync to maintain back-up and synchronization between the two. One of the
major design goals of asd is a completely transparent user experience.

## Documentation
Consult the man page or the wiki page: https://wiki.archlinux.org/index.php/Anything-sync-daemon

Consult the `asd(1)` man page (available [here](/USAGE.md)) or
[the Arch Linux `asd` wiki page](https://wiki.archlinux.org/index.php/Anything-sync-daemon).

## Installation from Source
To build from source, see the included INSTALL text document.

To build from source, see [the included INSTALL](/INSTALL) text document.

## Installation from Distro Packages
* ![logo](http://www.monitorix.org/imgs/archlinux.png "arch logo")Arch: in the [AUR](https://aur.archlinux.org/packages/anything-sync-daemon).

- ![logo](http://www.monitorix.org/imgs/archlinux.png "arch logo")Arch: in the [AUR](https://aur.archlinux.org/packages/anything-sync-daemon).

## Installation with the [Nix package manager](https://nixos.org)
Loading