Permissions Help for Linux based web server

I have a PHP script that uses MYSQLDUMP and TAR to generate a zipped backup file of my database. Then it uploads that file to dropbox.

When I was testing it, I had the PHP script in a directory that I could see from a browser. Ideally now I want to move the script outside of httpdocs directory

Now that it's all tested I want to use CRONTAB to run the script nightly.

The problem is, (I think) the script, now that it's being run via the PHP command rather than through Apache, it's running as a different user.

The result of this is, the MYSQLDUMP command cannot create the output file anymore. (even running the script from the dir inside httpdocs where it was previously working fine.)

The directory I want to to save in is set to 777. (The same dir as it was using when I ran the script manually)

If I try the same MYSQLDUMP command via an SSH connection then it works fine. It will create the file in the place I want. It's just that when the MSQYDUMP is done through PHP it's not able to output to that directory.

Is it running from the crontab of the same user as is used to run the web server?

Comments on this post

aitken325i agrees

The moon on the one hand, the dawn on the other:
The moon is my sister, the dawn is my brother.
The moon on my left and the dawn on my right.
My brother, good morning: my sister, good night.
-- Hilaire Belloc