Thanks a lot guys
Quote:
What have you tried so far?
|
Never wrote any script before,but I was looking at rc.S and trying to figure out a way to use this for my script:
Code:
READWRITE=no
if touch /fsrwtestfile 2>/dev/null; then
rm -f /fsrwtestfile
READWRITE=yes
fi
but couldn't think of anything to check if drive was connected via USB.
Quote:
What help You need: to test if the disk is connected, or to make some proc with the disk to make it no sleep?
|
I want my drive to not sleep automatically. I could only think of creating and deleting an empty file every 15 minutes but couldn't figure out how to put them in if, else loop and create a bash script.
Quote:
A simple `fdisk -l` should wake up any connected drive regardless of whether it's mounted or not.
|
Thanks mRgOBLIN, that is indeed the smart solution..now if I set up a cron job to do that every 15 minutes and then if I start a file copy operation of say 10 GB then while the operation is in progress and at the same time the cron initiates fdisk -l, will it create any problem?
*Edit* Alright I tried it manually and it didn't create any problem, both cp and fdisk -l carried out successfully simultaneously.
Still I'd like to know what you think.