Needs work
Project:
Backup Files
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
12 Dec 2008 at 04:42 UTC
Updated:
3 Aug 2009 at 11:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
RickA99 commentedI have Drupal 6.9 installed in a sub-directory and I tried the code fix above and got the same error message as before, "Does not exist: /sites/all/themes/" until I added a period in front of the backup directory path.
"Test Settings" didn't work: /sites/all/modules
"Test Settings" worked: ./sites/all/modules
Unfortunately, when I tried to do an actual backup, the file that got downloaded was empty.
Error message:
warning: filesize() [function.filesize]: stat failed for /backup.tgz in /[my-path]/sites/all/modules/backup_files/backup_files.module on line 216.
warning: fopen(/backup.tgz) [function.fopen]: failed to open stream: No such file or directory in /[my-path]//sites/all/modules/backup_files/backup_files.module on line 220.
Comment #2
mikeytown2 commentedComment #3
mikeytown2 commentedComment #4
davidjany commentedWith minor changings and a existing and writable tmp-dir it's working for me in a subdir.
Thx.
Comment #5
jhodgdonJust a note that this patch doesn't work for me, although I have the same issue. The module is not finding the files, or looking in the correct location. I'm on a LAMP server with Drupal installed (for the moment) in a subdirectory.
Comment #6
jhodgdonSo I'm marking this as "needs work", because this patch evidently doesn't solve the problem generally enough.
Comment #7
jhodgdonThe problem is that base_path() (which is used in this function) returns the base *url*, not the base file path. You can't really make assumptions about how to derive a path from this -- it is very dependent on the web server, Drupal installation, etc.
You need to instead do something like what conf_path() does, or better yet just use conf_path(). If the module is meant to only backup files within the sites/whatever/files directory, then file_directory_path() will give you a path to that directory.
Comment #8
sinasquax commentedFor me this patch works :
On backup_files.module, replace in line 155 :
$rp = realpath('.'. $bp. trim($dir));by :
$rp = realpath('./' . trim($dir));And replace in line 172 :
$bfn = realpath('.'. $bp. $temp). '/backup.tgz';by :
$bfn = realpath('./' . $temp). '/backup.tgz';And you can remove line 131 too.
It works with drupal installed in sub directory and in root directory