Answer the question
In order to leave comments, you need to log in
How to holistically copy all the files in a bunch from one dir to another, given that the server can fakapnutsya?
Files are periodically generated by the script in the TEMP directory by the cron . The ACT folder contains actual files that are used by people / programs for their own purposes.
How to safely (holistically) update the files after the generation is completed, given that the server may crash / crash the script / etc at the time of copying? Like transactions in a DBMS - either we commit all changes, or nothing / rollback. There should always be full working files at the battle, even though they are old, but most importantly working and of the same version.
Interested in the algorithm and technical capabilities, implementation language or in php or python.
As I see it:
1. begin transaction
2. clear ACT
3. copy files from TEMP to ACT
4. commit
Advanced.
The names of files in folders can be the same, i.e. overwriting maybe, plus old versions of files in battle should not remain after updating, only what was in tempo.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question