How to find the newly added disk using a bash script?
How to implement in a script the process of finding just that added hard drive with the withdrawal of his name, serial number and logical name?
2 answers
The logic goes like this:
1. Keep in a file the output of the last df
2. To run the script that contains the df command every 5 minutes (the cron - crontab-e)
3. If there are differences in the output file - show variations.
The differences can be found using the diff command, if you write all files
you can start with this:
dmesg -T | grep mounted
Find more questions by tags Ubuntubash
cron is not reliable (if the error can stop working) - buck53 commented on June 10th 19 at 14:51
In the best case just in bootlogo you will be able in turn to see but the date was not specified. - Jeff28 commented on June 10th 19 at 14:57