Repository navigation
plexdo rescan
plexdo-rescan - scan a library for new files, or list the server's activity
plexdo rescan LIBRARY [-n] [GLOBAL OPTIONS]
plexdo rescan -s [GLOBAL OPTIONS]
Asks the server to scan a library's folders for files that have been added, changed, or removed, the same as Scan Library Files in Plex. Only files are scanned; existing items' metadata is not refreshed. The scan runs on the server after the command has returned.
With -s, nothing is scanned; instead the server's background activity is listed, scans among it, so a scan started earlier can be followed.
LIBRARY
The library to scan, by numeric ID or title. Required unless -s is given. With -s it is not used, though a title matching no library is still an error, since titles are resolved before anything else.
-s, --status
List the server's current activity instead of scanning: library scans, and whatever else the server is busy with.
-n, --now
Before starting the scan, cancel every scan pending or running on every library, not only on LIBRARY, so this one starts at once rather than waiting in the queue.
-f, --format FORMAT; --json
Choose the format of the -s listing. A scan prints one plain line in any format.
-W, --wide
Never truncate the -s table; titles and subtitles are what would shrink.
--throttle SECONDS
No effect: neither form loops over requests in a way that is paced.
-v, --verbose; --debug
--verbose reports the scan being triggered and, with -n, the cancellation; --debug adds each library's cancellation.
--dry-run
Resolve LIBRARY and stop: nothing is cancelled and no scan starts. -s is unaffected, since listing changes nothing.
-V, --version; -h, --help
Print the version, or this command's help, and exit.
·
-s takes precedence over everything else: given -s, nothing is scanned or cancelled, and -n is ignored. So is LIBRARY, except that a title matching no library is still reported as an error.
·
Without -s, LIBRARY is required.
·
-n cancels scans on every library, including ones unrelated to LIBRARY; any of those still wanted must be started again.
·
--dry-run suppresses -n's cancellation as well as the scan.
A scan prints one line on standard output:
Rescan triggered for library: 'TV Shows'
-s lists one record per activity:
type
What kind of work it is.
title, subtitle
What the server says it is doing.
progress
How far along it is, as a percentage.
uuid
The activity's identifier.
With no activity, -s prints No active scan jobs. on standard error.
0 on success. 1 when LIBRARY is missing without -s, or not found, or ambiguous. See plexdo-conventions(7).
Scan a library after copying new files into it:
plexdo rescan "TV Shows"
Scan one library at once, cancelling the scans queued ahead of it:
plexdo rescan Movies -n
Follow the scan while it runs:
watch -n 5 plexdo rescan -s
Scan a library from a script once a download finishes, quietly:
plexdo rescan 2 > /dev/null
plexdo-status(1), plexdo-find-missing(1), plexdo-list-libraries(1), plexdo-conventions(7), plexdo(1)