Fli
11-04-2018, 10:26 AM
You are on Linux and you do not want your external HDD to stop after being idle. You want to keep it active and accessible at all times. How to do that?
I do it like this:
1. discover path to the mounted filesystem of the external HDD:
df -h
(in my case /media/me/BACKUP 750GB)
This way, i can execute command to keep HDD awake until i reboot the system or logout:
while true;do sleep 20 && if [ -d "/media/lynx/BACKUP 750GB/" ];then touch "/media/lynx/BACKUP 750GB/0";fi;done &
or i can setup a cronjob that will do it non stop across PC reboots for that particular HDD:
2. edit crontab:
crontab -e
3. add new line:
* * * * * if [ -d "/media/lynx/BACKUP 750GB/" ];then touch "/media/lynx/BACKUP 750GB/0";fi
(change bold text to reflect your path)
Save changes ( :wq and Enter key OR Ctrl+X, Y key and Enter key)
4. check your system log to see what cron is reporting about your job:
echo -e "\nTime now: $(date)";sudo tail -f /var/log/{*cron*,syslog} 2>/dev/null
Do you know better way or the tweak?
I do it like this:
1. discover path to the mounted filesystem of the external HDD:
df -h
(in my case /media/me/BACKUP 750GB)
This way, i can execute command to keep HDD awake until i reboot the system or logout:
while true;do sleep 20 && if [ -d "/media/lynx/BACKUP 750GB/" ];then touch "/media/lynx/BACKUP 750GB/0";fi;done &
or i can setup a cronjob that will do it non stop across PC reboots for that particular HDD:
2. edit crontab:
crontab -e
3. add new line:
* * * * * if [ -d "/media/lynx/BACKUP 750GB/" ];then touch "/media/lynx/BACKUP 750GB/0";fi
(change bold text to reflect your path)
Save changes ( :wq and Enter key OR Ctrl+X, Y key and Enter key)
4. check your system log to see what cron is reporting about your job:
echo -e "\nTime now: $(date)";sudo tail -f /var/log/{*cron*,syslog} 2>/dev/null
Do you know better way or the tweak?