RAUL BENITEZ's picture

Maybe somebody here can answer this.

 


I have an ubuntu server running 10.04.1 which I have webmin 1.52 installed. In the Postgres server tab in webmin you can setup and run backups of your databases. When I try to make a backup and choose the option "Create destination directory?" I choose Yes, because I want each backup in its own directory. When I click "backup now" the script fails and says permission denied when trying to write to the directory it just made and I have to log into the server and do a chmod to that directory and then run the backup in webmin again. So my question is why am I getting that permissions error when I try to make a directory in the postgres backup GUI? Shouldn't it make the directory its making automatically writable? or am I missing something? 

Hope I was clear enough, thanks!

Forum: 
Jeremy Davis's picture

Even if you're not then it should be somewhat similar (TKL v11.x is basd on Ubuntu 10.04).

My first guess is that folder is owned by root, but the backup process is running as a limited user. To troubleshoot this, I'd check who owns the newly created folders, what permissions are set by default. Then change permissions on the folders (to 777) and run your backup. Then check the ownership/permissions of the new files.

RAUL BENITEZ's picture

Thanks for the response, yes the server in this case I created with turnkey. 

 

Anyway I ran another test backup as you suggested and took at look at whole owned the directory that the backup script made, its owned by root. When I chmod the directory its also owned by root.

 

 

 

drwxrwxrwx  2 root root     4096 May  3 17:43 pg20120503
drwxr-xr-x  2 root root        4096 May  4 15:10 pg20120504
 
 
The may 3 is the one I made were I had to go and chmod the directroy that was made and then had to go back into webmin and run the backup script agian.
 
the may 4 one is the one i just made without chmod the directory.
 
here is the error i get in webmin
 
Failed to backup database : pg_dump failed :
	pg_dump: [archiver] could not open output file "/var/backups/pg20120504/nearby.sql": Permission denied

Failed to backup database : pg_dump failed :

	pg_dump: [archiver] could not open output file "/var/backups/pg20120504/nearby_test.sql": Permission denied

Failed to backup database : pg_dump failed :

	pg_dump: [archiver] could not open output file "/var/backups/pg20120504/postgres.sql": Permission denied

Database template0 is not accepting connections.

Failed to backup database : pg_dump failed :

	pg_dump: [archiver] could not open output file "/var/backups/pg20120504/template1.sql": Permission denied

Scheduled backup for database left disabled.

Add new comment