Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
302fc21d05 |
@@ -114,20 +114,15 @@ docker run --rm -v /srv:/srv:ro -v /var/lib/sfdupes:/var/lib/sfdupes \
|
|||||||
Run `scan` as root, so that it can read every file. `scan` warns about a
|
Run `scan` as root, so that it can read every file. `scan` warns about a
|
||||||
directory it cannot read, and about a new or changed file it cannot read. It
|
directory it cannot read, and about a new or changed file it cannot read. It
|
||||||
skips the path and deletes the records at or below it (see "Rules for the
|
skips the path and deletes the records at or below it (see "Rules for the
|
||||||
walk").
|
walk"). As the file `/etc/cron.d/sfdupes`:
|
||||||
|
|
||||||
An unmounted disk leaves its mount point empty, so `scan` deletes every record
|
|
||||||
under it, and the next scan reads every file on the disk again. Test the mount
|
|
||||||
point of each disk at or below `/srv` with its own `mountpoint -q`, joined with
|
|
||||||
`&&`, and test `/srv` only when it is one. As the file `/etc/cron.d/sfdupes`:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
30 3 * * * root if mountpoint -q /srv; then /usr/local/bin/sfdupes scan /srv 2>>/var/log/sfdupes.log || tail -n 3 /var/log/sfdupes.log; else echo "a disk is not mounted; scan of /srv skipped"; fi
|
30 3 * * * root /usr/local/bin/sfdupes scan /srv 2>>/var/log/sfdupes.log || tail -n 3 /var/log/sfdupes.log
|
||||||
```
|
```
|
||||||
|
|
||||||
- The first scan creates `/var/lib/sfdupes/db.sqlite` and its directory. To keep
|
- The first scan creates `/var/lib/sfdupes/db.sqlite` and its directory. To keep
|
||||||
the database elsewhere, put `SFDUPES_DATABASE=/path/to/db.sqlite` directly
|
the database elsewhere, put `SFDUPES_DATABASE=/path/to/db.sqlite` before the
|
||||||
before `/usr/local/bin/sfdupes`.
|
command on the same line.
|
||||||
- `scan` writes nothing to stdout. Its stderr, appended here to
|
- `scan` writes nothing to stdout. Its stderr, appended here to
|
||||||
`/var/log/sfdupes.log`, holds:
|
`/var/log/sfdupes.log`, holds:
|
||||||
- one line naming the database;
|
- one line naming the database;
|
||||||
|
|||||||
Reference in new issue
Block a user