With Backup and Migrate enabled, I get the following error message at the top of the Status Report page when I run Cron manually from this:

warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/tmp/mysql.sock) is not within the allowed path(s):

The error message goes on to give specific allowed paths in. I wasn't sure if it was safe to post that specific info. If it would be considered safe and the allowed paths info would be helpful I'll be happy to follow up with that info.

Cron seems to be running run ok, and Backup and Migrate also seems to be working properly. There are no errors reported in the email notice I get from the webhost server each time cron is run automatically. Scheduled backups have been successfully created and tested to be good after both manual and automatic running of Cron.

Again, the error only occurs when I run cron manually. This error is definitely somehow related to Backup and Migrate module. If I disable this module, I do not get the error.

Comments

Leo Pitt’s picture

I had the same problem and fixed it by changing my File System Temporary Directory:

It was set to "/tmp", and I changed it to "sites/default/files/tmp"

I guess that "/tmp" is in the server root and for security reasons the server is quite restrictive about what can write there (I'm not a Linux guru - so my explanation is a bit vague).

Preumably, when backup and migratre is run via cron, the linux user that is runing the script is different from when it is run manually, and that runs into some kind of permissions issue with relation to the /tmp directory.

So my solution is to make sure the File System Temporary Directory is within the Drupal installations' files path.

Please post back here if that resolves the issue for you.

oneklema’s picture

I changed my File System Temporary Directory from "/tmp" to "sites/default/files/tmp" and created the "sites/default/files/tmp" directory and it fixed the problem for me.

ronan’s picture

Be very careful moving your tmp directory inside your web root as temporary files will then become publicly available (which may not be desirable). Backup and migrate's temporary files have an obscure name so the paths to them shouldn't be guessable, but other modules may write sensitive data to temp at a predictable path.

Also, this issue (which is a deficiency of the drupal's scan_directory function) is fixed in version two which basically re implements that function to avoid the issue.

ronan’s picture

Status: Active » Fixed

This should be fixed now in the latest dev as I backported the tmp delete code from the 2.x branch

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.