I completed the install but when I run backup I get:

* warning: rename(/tmp/drupal-backup-db-hVyXzS,drupal-backup-db-20070319202041-443808657.tgz) [function.rename]: Permission denied in /var/www/vhosts/FOTHR.org/httpdocs/modules/backup/backup_lib.php on line 77.
* backup_database(): Renaming file '/tmp/drupal-backup-db-hVyXzS' to 'drupal-backup-db-20070319202041-443808657.tgz' failed

Is this a path problem? or a permission problem? or? I have Drupal installed in the root dir.

Comments

dmuth’s picture

Assigned: THOUGHTOUT » dmuth
Status: Active » Fixed

Hiya,

It appears to be a permission issue on your end. Here is the key part (with some bolding by me):

warning: rename(/tmp/drupal-backup-db-hVyXzS,drupal-backup-db-20070319202041-443808657.tgz) [function.rename]: Permission denied in /var/www/vhosts/FOTHR.org/httpdocs/modules/backup/backup_lib.php on line 77.

However, I think it sucks that you had to run an entire backup only to have the script say, "sorry, just kidding!" at the very end. So I "fixed" this bug by writing a little code that will check the permissions of the target directory BEFORE the backup is started. That way, if there are any issues, the script will not even permit you to make a backup and provide you with more useful information.

I just checked in the changes and tagged them as "DRUPAL-5--1-1". As soon as Drupal builds a new tarball from that, you should be able to download the updated version.

Thank you for bringing this to my attention.

-- Doug

THOUGHTOUT’s picture

Wow, that was quick and what I figured the problem is. Without waiting for the update, what is the TARGET directory and the permission need to be set to?

Thanks again
Mike

dmuth’s picture

Status: Fixed » Active

The target directory is your webserver's document root. The permissions should be set so that whatever use the webserver is running as can write to it.

In most instances, a permission setting of 0777 will work, but at that implies, it also makes the directory world-writable, which may not be desirable if there are other users on that machine.

I'll reopen this bug, so I can add a feature where the user can specify what directory to write the backup to. That should eliminate additional issues like this in the future.

-- Doug

dmuth’s picture

Status: Active » Closed (fixed)

Okay, I just committed a new version of this module (under CVS tag DRUPAL-5--1-2) which now has a "configuration" section and will allow you to specify the target directory where the backup is to be performed. Also, it will check the target directory and make sure it is writable before saving the configuation change OR beginning the backup. Enjoy!

-- Doug

BobLouis’s picture

Hi, trying to set a backup configuration directory, i got the following message:

Path '/backup' is not writable. Note that the user the webserver runs as may be different from the user that owns that directory. Please contact your SysAdmin for further assistance.

However, I set permissions for that directory on 777.
Any idea to solve the issue?

dmuth’s picture

Bob,

Try removing the leading slash from "/backup" and try again.

Thanks,

-- Doug

BobLouis’s picture

Thank you Doug: it works.

But now I have the following message:

* warning: popen() has been disabled for security reasons in /home/guirec/public_html/rennews/modules/backup/functions.inc.php on line 69.
* backup_database(): Unable to run command 'mysqldump -u guirec_drpl1 -h localhost -pyOMYVg[jBoQ7 guirec_drpl1 |gzip >/tmp/drupal-backup-db-FbFVEd '

Is it something disabled by my host? Or is it workable on a "drupal" side?

dmuth’s picture

Your webhost probably has "safe mode" enabled in PHP. Ask them not to do that. :-)

-- Doug

BobLouis’s picture

Doug, I asked them to disable Safe Mode.
What they did :

safe_mode = Off
safe_mode_gid = Off
sql.safe_mode = Off

Still have this error message:

* warning: popen() has been disabled for security reasons in /home/guirec/public_html/rennews/modules/backup/functions.inc.php on line 69.
* backup_database(): Unable to run command 'mysqldump -u guirec_drpl1 -h localhost -pyOMYVg[jBoQ7 guirec_drpl1 |gzip >/tmp/drupal-backup-db-CGCxXc '

Any idea of the cause?

BobLouis’s picture

No solution so...? :)