A
A
Anton2019-07-21 10:20:04
bash
Anton, 2019-07-21 10:20:04

How to write a script to reset a site?

A separate backup/ directory contains a database dump and a folder with the site's source files (images).
You need to do the following via cron once a day:
1) delete files from the /files folder
2) wait until all files are deleted, then proceed to the next step
3) copy the files to the /files folder from /backup/files
4) delete the tables from databases
5) wait for the tables to be deleted, then go to the next step
6) roll the database dump
How to write a script with such an algorithm?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2019-07-21
@schepetkov

well, wait for the execution of the script will default to this leoko
1 delete rm -rf
2. default
3. cp
4. mysql + drop tables
5 default
5. mysql -u**** -p*** dbname < test.sql ( by the way, in this version, it will drop all the tables and write everything from the dump)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question