I use incron
to create backups for a website, and I like to redirect all requests to an other site when/while my scripts are running.
What I have done so far...
incron
runs some scripts every time I update files in /var/www
.
First it adds some entries to a database.
Then it makes an gnu incremental backup with tar
. After that it uses mysqldump
for extraction of the database and gzip
for compression the sql file.
Now I like to add statistics to my database too.
I was thinking of adding /var/log/apache2/access.log
to incron
.
But this way I can mess up my database backups. I need a save way to extract my database without shutting down apache
nor mysql
. I could block write access on mysql but my website will still be available and I cant update statistics in the mean time without getting an error.
Is there a way to redirect all access of one domain, as long my scripts are running ? Maybe mod_rewrite
with some if
, but which arguments I have to use then ?
to be hornest, I have no clue how to archive this and I will be pleased to hear some advice.
Apache 2.4.10
MySQL 5.7
Debian Jessie