Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 2901

General Debian • Re: How to determine if a directory is a mountpoint and if it is mounted or not?

$
0
0
As @dilberts_left_nut mentioned mountpoint is the way. Here's an example from one of my backup scripts - this bails out of the script and sets an errorlevel if there isn't a filesystem mounted to the mountpoint.

Code:

if mountpoint -q /media/external; then    /usr/bin/systemctl stop qbittorrent.service radarr.service sonarr.service prowlarr.service    /usr/bin/rsync -qam --delete /media/internal/music/ /media/external/music &    /usr/bin/rsync -qam --delete /media/internal/videos/ /media/external/videos &else    exit 1

Statistics: Posted by wizard10000 — 2024-07-30 10:09



Viewing all articles
Browse latest Browse all 2901

Trending Articles