Skip to content
Advertisement

Export Database & Zip it using PHP shell_exec()

I create a quick route that triggering an fn that runs shell_exec() to back up my database.

JavaScript

To save server space, I also want to zip what I dumped

JavaScript

I’m not sure why the zip command never runs even if I put a sleep() after the first one, and in betweens.

What did I do wrong?

Note : the tar command working perfectly if I copy and run it on the command line in the server.


Code

JavaScript

Advertisement

Answer

I think you’re missing “/home/john/” part from the tar command so it wont find the file.

Maybe this will help:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement