Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create a backup script that gets all the contents of two specific directories, and retains their structure. So for example I have one directory /images/ and another one /neou_cms/images/users. The zip should only include the files inside these directories, and retain their structure so I can "restore" by unzipping at the root. I have seen similar techniques for one directory, as well as for the entire site, but since the only files that would be changed on my site are located in these two directories I do not see the benefit of wasting 100mb or more on a zip file. Does anyone know (specifically) how I can accomplish this?


migration rejected from Jul 11 '13 at 3:46

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as off-topic by Sathya Jul 11 '13 at 3:46

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question is not about computer hardware or software, within the scope defined in the help center." – Sathya
If this question can be reworded to fit the rules in the help center, please edit the question.

With exec() and a command like zip -r images/ dir2/, or using ZipArchive::addFile() after traversing the directories and building a file list yourself. – mario Jul 9 '13 at 0:12

Browse other questions tagged .