SunQuest
           PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old May 4th, 2008, 11:37 PM
DoctorCox DoctorCox is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 2 DoctorCox User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 33 sec
Reputation Power: 0
Trying to make a backup script, need help with permissions

Gentlemen,

I am trying to create a PHP script that will create then FTP to another server a GZIPped backup of our CMS database. It's a FreeBSD server running Apache and cPanel, but the same script will be deployed on a Linux server too should it prove successful.

The FTP stuff is easy, but where I have gotten stuck is getting the permissions right to allow mysqldump to output the file successfully. Before anyone replies, PHPSUEXEC is more than likely not a valid option for this operation. It introduces problems of it's own, and from what I have, will more than likely break the CMS I have developed. Only two sets of permissions and ownership will allow this script to work, and I would like the input of people more knowledgeable than myself on such matters on the potential risks of either approach.

- Obviously 0777 permissions is the first. But I have read and seen first hand the risks of doing this. However, if I use a directory that's outside of the Apache home directory, is there still a risk someone could use the directory to break in? Realistically, how could they know it was there anyway? The only way would be to break in and find the PHP backup script, in which case they have probably got in to the point where the consequences of a 0777 folder are relatively little.
- The next idea that worked was to chown the backup folder (which again is still outside of /home) to user nobody. To my inexperienced eye, this seems unlikely to have risks, or at least is the least risky of the two options.

Reply With Quote
  #2  
Old May 6th, 2008, 12:58 AM
icandothat's Avatar
icandothat icandothat is offline
Moderator
Click here for more information.
 
Join Date: Apr 2007
Location: San Diego, CA
Posts: 1,551 icandothat User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 2 h 55 m 16 sec
Reputation Power: 3
I think you need to give the mysql user, the account mysql is running under, write access to the folder you're planning on dumping the file to.
__________________
There is no spoon.

Reply With Quote
  #3  
Old May 6th, 2008, 05:59 PM
DoctorCox DoctorCox is offline
Registered User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 2 DoctorCox User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 33 sec
Reputation Power: 0
I am really not that familiar with all the different commands, could you please give me more detail. I know how to change the owner of a folder, but not how to give an individual user write access. I have tried various command line references, but could not locate anything that would work.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Trying to make a backup script, need help with permissions


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway