User has a (incremental) backup script using
rsync, to external device. This was erroring on an SSD he had. Turns out his device was formatted
exFAT. That means I need to detect this in the script, as I need to alter the options to
rsync (e.g., exFAT cannot handle symbolic links, no owner/group permissions, etc.).
User is running Linux Mint. I run Ubuntu. I can only assume/hope that a solution for my Ubuntu will work for his Mint.
I have looked at:
- How do I know if a partition is ext2, ext3, or ext4?
- How to tell what type of filesystem you're on?
There are a variety of good suggestions there, but I do not see one which meets my requirements, which are:
- Must report (parseable)
exfatexplicitly, not just say
fuseblk(which it will for both
ntfs, I need to distinguish).
- Must not require sudo.
- Must be executable starting from a directory path on the file system (can assume it will be mounted), not just starting from a
From the suggestions I have tried:
file -sL: require sudo and/or
/dev/..., only reports
stat -f -c %T: accept directory, but report only
Is there a single, simple command which meets all these criteria? Or,
blkid seem to report
ntfs correctly, if I need to pass them the
/dev how do I get that suitably from the directory path in script?