Re: Checking for a mount in a shell script (Was: Re: Preparing for Debian 13)
On Sun, May 18, 2025 at 4:51 PM Andy Smith wrote:
>
> Hi,
>
> On Sun, May 18, 2025 at 12:47:25PM -0400, Default User wrote:
> > Since I know almost no shell scripting, the rsync usb drive A
> > to usb drive B copy is done with a simple bash script consisting
> > only of the rsync backup command, with options and parameters, but
> > without any code to verify that usb drive B is attached.
>
> If your backup script is a bash script then all you need do is put
> something like:
>
> if ! findmnt /mnt/usb-drive-b; then
just out of curiosity.. why "findmnt" instead of
if [ ! -d /mnt/usb-drive-b ]; then
Thanks
Lee
Reply to: