hard drive - bash protect HD from excessive use -



hard drive - bash protect HD from excessive use -

how avoid breaking hd? have bash script running on ubuntu machine, meta code:

bash1.sh

while(true) run bash2.sh sleep 60 seconds done

bash2.sh:

if(directory empty): exit process file delete file

the directory network shared, , computer not doing else. 1 time per day new file arrives , processed. (i know bash1.sh can replaced watch). concern bash1.sh reading bash2.sh everytime - can presumably avoided having 1 script!? , bash2.sh reading same directory everytime. directory read hd, or ubuntu somehow caching dir in ram? -so read when changes? problem same place on hd read every time, or not matter because hd spinning? if hd never sleeps, matter if set loop time downwards 1 second?

maybe directory pure ram dir - how do that? -or there simple way check if has arrived on network without reading directory?

reading file or directory 1 time every 60 seconds not excessive use.

seriously, don't worry it.

if it's worrying you, can rethink strategy detecting file.

for example, need know, within 60 seconds, file has arrived? can arrive time during day? can parts of day considered unlikely?

using info that, can adjust timing of checks suit. if file supposed delivered after 4pm, don't check @ before then.

check every 60 seconds between 4pm , 5pm, every 10 minutes after that.

these business-related decisions can made still suggest it's unnecessary. provided regularly disks (and have standby hardware if need in hurry), shouldn't lose anything.

in fact, if really paranoid, dedicate entire machine this, sole purpose receive file via ftp and, when arrives, send across real processing box.

put nothing else on machine , have warm standby (exactly same software, ip address , on powered down) that, if fails, standby can activated in minutes.

the real processing machine written 1 time day - that's unlikely impact disk lifetime.

that's too paranoid liking shows there ways mitigate problem.

bash hard-drive

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -