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.

Yes, it is possible. Many people used "Lock Files" as ad hoc semaphores to accomplish this task.

thx reply,

could advise how to do that ? thx

I can think of a solution as follows.

Write a shell script that runs forever and removes write permission on the directory in specified time gap. Better u can have a cron job to do that. But that does not satisfy the second requirement.