Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
HanabishiRecca committed Nov 14, 2023
1 parent 7181e27 commit 7a93274
Showing 1 changed file with 27 additions and 24 deletions.
51 changes: 27 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,43 @@
## Caches manager
# Caches manager

A simple script that helps keep selected directories clean by symlinking or mounting to tmpfs ramdisk.
Useful for temporary, cache and other junk directories.
Useful for temporary, cache and other junk directories.

### Usage
## Installation

1. Enable system and/or user services.
- Copy `caches-manager` script to some `$PATH` directory, e.g. `/usr/bin`.
- Copy `systemd` directory to `/usr/lib`.

If you want to use the script without systemd, just make it run early at system startup with `--system` flag and on user log-in with `--user` flag.

## Usage

### Services

Enable system, user or both services depending on your needs.

# systemctl enable caches-manager.service
$ systemctl --user enable caches-manager.service

2. Make your configs.
Changes will be applied on the next boot (or user log-in in case of the user service). You can force changes by executing the services or running the script manually, but this is not recommended.

The script reads all `.conf` files from respective directories:
- `/etc/caches-manager/system` - system-wide configs.
- `/etc/caches-manager/user` - configs for all users.
- `$XDG_CONFIG_HOME/caches-manager` (`~/.config/caches-manager`) - per-user configs.
### Configs

Configs are read as one path per line. Default mode of operation is to symlink the directory.
If you want to use mount instead, prefix the path with `b:`. Mounts require root privileges but more failsafe and keep actual directories if the service was disabled/uninstalled, so they are preferred for system directories.
System-wide configs require full absolute paths (e.g. `b:/var/cache`).
User configs treat paths relative to user home directory (e.g. `.cache` will be resolved to `~/.cache`).

**WARNING!** Tmpfs keeps data in RAM and drops it on every shutdown or reboot.
The app will backup existing non-empty directories just in case.
The script reads all `.conf` files from respective directories:

3. Changes will be applied on the next boot (or user log-in in case of user service). You can force changes by executing the services or running the script manually, but this is not recommended.
- `/etc/caches-manager/system` - system-wide configs.
- `/etc/caches-manager/user` - configs for all users.
- `$XDG_CONFIG_HOME/caches-manager` (`~/.config/caches-manager`) - per-user configs.

### Packages
Configs are read as one path per line. Default mode of operation is to symlink the directory. If target exists, the app will backup existing content.
If you want to use mount instead, prefix the path with `b:`. Mounts require root privileges but more failsafe and non-destructive (mounts overlay existing content), so they are preferred for system directories.
System-wide configs require full absolute paths (e.g. `b:/var/cache`).
User configs treat paths relative to user home directory (e.g. `.cache` will be resolved to `~/.cache`).

**Arch Linux**
- [`caches-manager`](https://aur.archlinux.org/packages/caches-manager) <sup>AUR</sup>
**WARNING!** Tmpfs keeps data in RAM and drops it on every shutdown or reboot.

### Manual installation
## Packages

1. Copy `caches-manager` script to some `$PATH` directory, e.g. `/usr/bin`.
2. Copy `systemd` directory to `/usr/lib`.
**Arch Linux AUR**

If you want to use the script without systemd, just make it run early at system startup with `--system` flag and on user log-in with `--user` flag.
- [`caches-manager`](https://aur.archlinux.org/packages/caches-manager)

0 comments on commit 7a93274

Please sign in to comment.