Andy Smith <a...@strugglers.net> writes:

> 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. 
>> 
>> I really should learn more shell scripting. That is something 
>> else I will get to "Real Soon Now".
>> :)
>
> If your backup script is a bash script then all you need do is put
> something like:
>
> if ! findmnt /mnt/usb-drive-b; then
>     echo "Mount USB drive B before running this!" >&2
>     exit 1
> fi

why not
if ! mountpoint  /mnt/usb-drive-b ; then ...
?

KJ
-- 
http://wolnelektury.pl/wesprzyj/teraz/
EMACS = Even a Master of Arts Comes Simpler

Reply via email to