Operating System - HP-UX
1850239 Members
3441 Online
104053 Solutions
New Discussion

Re: Suspend to write file

 
hanyyu1
Advisor

Suspend to write file

We have a common directory , everyone can put file to it , but I found that there is a problem if the user continouosly write files to this directory while the another application is running at the same time , so I want temporaily "protect" the directory , no files can be write to it at a specific time ( eg. from every 1:00am - 3:00am , 7am - 8:30am & 5pm - 6:45pm ) , the system should temporaily store the files in the above time and write back to the directory after the "pretection" period , is it possible ? thx.
3 REPLIES 3
Muthukumar_5
Honored Contributor

Re: Suspend to write file

It is not a problem to store files in a directory. It is a problem when one application writing into a file and another application is trying to write in that. It will not happened bcas of file locking.

what is the problem for you that another application writting into same directory?

hth.

Easy to suggest when don't know about the problem!
Steven E. Protter
Exalted Contributor

Re: Suspend to write file

Shalom hanyyu1,

Its not a system problem, its an application problem.

The application's are probaby fighting to write to the same file at the same time.

The application should be reconfigured to write to different directories I think.

You can have root do a chmod 000 on the directory in question via a cron job, but that won't effect writes in progress, it will prevent new ones. chmod 000 is an extreme example, but you can take away write capabilities a number of ways. chmod a-w /dirname/


SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
hanyyu1
Advisor

Re: Suspend to write file

thx replies,

Steven ,
if change 000 , it seems the file will be lost if it is writing to the directory .