I am running a demo of a CMS on my server. In this demo, potential clients can try out the back-end of the CMS. This is why I created a php-script which deletes the whole CMS folder and copies a back-up back into it. This way, each time the script is run, the demo site is resored.
Thing is though, I am figuring out how to do this via cron job. The command I use is the following (I am running CentOS).
0 * * * * php /home/USER/public_html/replaceCMS.php
This replaces all files in the folder, but also causes a 500 internal server error. When I run the script using my browser, the problem does not appear.
I also tried unzipping a .zip with overwrite into the demo folder. Doing this with cPanel's file mananger, all went well. Doing it with unzip -o command causes the same error.
Does any of you know how come?