I am running a custom script for the backup schedule and transportation but the backup is handled by /scripts/pkgacct. I am having strange error that every time the schedule backup has ran, the htaccess file of a lo of sites are emptied. They all became 0kb.
So I went ahead to check /scripts/pkgacct file and I found following block
I am using EA4. I am mostly running WordPress sites and thus .htaccess file are needed with at least WordPress's default. For now, I run a script that find 0kb htaccess file and put the WordPress's default configurations back after the backup script. But this is unneeded extra step. Please tell me how can I fix this issue.
So I went ahead to check /scripts/pkgacct file and I found following block
Perl:
If the server is running EasyApache4, it may have added some clauses
into vhosts' .htaccess files, which we want to strip out. The target
server could be an EasyApache3 host, and won't have the same handlers
set, or could be an EasyApache4 host, but may not have the same set of
PHPs installed, and our PHP handler could very well cause the vhost to
simply stop serving pages.
Since we're using Archive::Tar::Builder to create the tar, and we can
do any sort of mapping that we like, we'll copy our .htaccess files
into the work directory, change their names, and return the remapping.
The caller will need to alter the mapping, to send things into the
$workdir/homedir tree, but this should be simple.
If the server is not running EasyApache4, we will return without
performing any action.
Last edited by a moderator: