Retrieve path device and filesystem via df command #607
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So, I finally decided to automate my backups and use backintime. I tested scheduled udev-triggered backups on a flash drive few days ago, everything worked fine. So I decided to configure backups on my external HDD today, but it didn't work, plugging in the drive didn't trigger backintime.
After a short investigation, I found out my udev file was set up to trigger on some unknown UUID, even
blkid
wouldn't list it. So, I dug in source code and figured out that thetools.device
function returnedNone
for my drive.The reason was: its label ('karlicoss hdd') contained a space, so it was mounted to
/media/karlicos/karlicoss hdd/
, however,/etc/mtab
treats spaces as separators, so he escapes paths likeAs you can see, spaces map to
\040
. So, probably a good idea is, instead of manually parsing/etc/mtab
, use thedf
command from coreutils, which does all the job for us.A followup question, what is the rationale behind this UUID fallback logic? In my case, it seemed to have cached the flash drives' UUID, and silently used it instead my HDD's UUID. Maybe, we should at list show some warning/notification to user so he knows something went not as expected?
P.S. I messed with previous PR and apparently github doesn't let to reopen branch which you force pushed so I made a new PR.