Hello again,

>From a private message,
> I modified your script slightly and it works for  me.

Thanks.

The drive isn't formatted and has a UUID such as 
2026-01-19-03-28-45-00. Shorter than a UUID for a file system.

After reading the reply I noticed that the UUID had changed.  It's 
revised periodically.  After writing?  Elapsed time is involved?  I 
don't understand in detail.

UUID isn't a time-invariant identity for the drive.  Two external 
drives here are the same model.  Serial number might identify.

Revised the code listed yesterday.  Now similar to this.

printf "destination is the serial number of a LaCie HDD connected by USB.\n";
destination="10000E000D959403";
printf 'destination=%s\n' "$destination";
if ! lsblk -o SERIAL | grep -F -- "$destination" > /dev/null ;
then
  printf "destination device not connected ";
  printf "or the serial number is wrong.  Aborting.\n";
else
  printf "destination device is connected.\n"
  dev= lsblk --nodeps -o name,serial | grep -F -- "$destination" | cut -d ' ' 
-f1 ;
  printf 'dev=%s is ready to receive backup.\n' "$dev";
  printf "Press any key to continue.\n";
  read -n 1 c;
  FTH;
fi;

OK in a simple test.  Suggestions always welcome.  Something may be 
more efficient  than the long pipeline.
lsblk --nodeps -o name,serial | grep -F -- "$destination" | cut -d ' ' -f1 

As happens too often, I was looking in the wrong place.  Thanks for 
the reply.

Thx,                            ... P.
                           
  
-- 
mobile:  +1 778 951 5147
VoIP:    +1 778 508 0020
Bcc: peter at e a s t h o p e dot c a
projects: en.wikibooks.org/wiki/User:PeterEasthope

Reply via email to