Answer the question
In order to leave comments, you need to log in
How to limit the capacity of a folder on the server?
The logic of the program is as follows.
When you run a php script, it in turn launches the .sh script for execution.
Files are downloaded to a certain folder.
It is not known in advance how many files.
You need to somehow set a limit on downloading files to a folder, i.e. when the folder is full, then .sh should be chopped off by itself.
Let's say the folder capacity is 5 MB and no more.
How to do this using Linux?
Many scripts and folders can work at the same time, so controlling everything through PHP is resource-intensive + there is no pointer to stop the script.
Answer the question
In order to leave comments, you need to log in
After each jump in the sh script, check the size of the folder (du -s) and if it exceeds, exit. If the files are small, then the error due to multithreading will not be very large.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question