solomon
12-08-2005, 07:41 AM
I'm trying to write a little script that creates backups of my many mysql databases. Everythings going fine but I'm at a little stumbling point - hopefully someone can help.
The way I am trying to do it is to create backup files by first copying a blank text file which already resides on the server using...
copy($file_to_copy , $name_of_copy);
...and then I intend to stuff the backup information into that duplicated, uniquely named backup file.
The problem I'm getting is ...
Warning: copy(mailinglist08Dec05132559.csv): failed to open stream: Permission denied
...regardless of how I chmod the source file. The script can 'see' the source file OK (I've noticed if I inte...ntionally mistype the source file I get different errors).
For completion, here's my simple copy function:
function f_CreateBackupFile($file_to_copy , $name_of_copy){
// CREATE A COPY OF THE BACKUP FILE AND NAME IT ACCORDINGLY
if (is_file($file_to_copy)){
if (copy($file_to_copy , $name_of_copy)) {
f_narrate("Created new file " . $name_of_copy , 6);
} else {
f_narrate("Failed to copy file " . $file_to_copy , 6);
}
} // END COPY BACKUP FILE LOOP
}
Thanks all!
The way I am trying to do it is to create backup files by first copying a blank text file which already resides on the server using...
copy($file_to_copy , $name_of_copy);
...and then I intend to stuff the backup information into that duplicated, uniquely named backup file.
The problem I'm getting is ...
Warning: copy(mailinglist08Dec05132559.csv): failed to open stream: Permission denied
...regardless of how I chmod the source file. The script can 'see' the source file OK (I've noticed if I inte...ntionally mistype the source file I get different errors).
For completion, here's my simple copy function:
function f_CreateBackupFile($file_to_copy , $name_of_copy){
// CREATE A COPY OF THE BACKUP FILE AND NAME IT ACCORDINGLY
if (is_file($file_to_copy)){
if (copy($file_to_copy , $name_of_copy)) {
f_narrate("Created new file " . $name_of_copy , 6);
} else {
f_narrate("Failed to copy file " . $file_to_copy , 6);
}
} // END COPY BACKUP FILE LOOP
}
Thanks all!