Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Automate file compression and encryption using zip, php on Linux OS

Posted on 2007-04-03
4
Medium Priority
?
372 Views
Last Modified: 2013-12-01
I want to have a script preferably php on a linux OS:

generate a random password
Zip a fixed list of files and encrypt with the above password
move the file to a specified location
generate an email with the link to the location above and ebed the password created above
send the email
create a cron job or other scheduled entry to remove the file a fixed time in the future

I can complete parts of this from my shell scripting days but I'm not sure of the most efficient way to do this in php
Your insights are greatly appreciated
0
Comment
Question by:jerrylmclaughlin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 19

Accepted Solution

by:
Michael701 earned 600 total points
ID: 18847599
What version of PHP?

Take a look at the zip library.

http://www.php.net/zip

Michael
0
 

Author Comment

by:jerrylmclaughlin
ID: 18847752
PHP 4.4.6
0
 
LVL 48

Assisted Solution

by:hernst42
hernst42 earned 200 total points
ID: 18848913
AFAIK there is no php-extension lib which is capable of creating zips with passwords, so generating the zip must be done via shell. You can use php to build the password, filelists, ... and use exec to create the zip with the external program. So in php it is often easier/more readable to add the error-handling and checking than in shell-scripts. If you have a intereaction with the user php is better to use as it has a easy way to access the parameters from the script.
0
 
LVL 51

Assisted Solution

by:ahoffmann
ahoffmann earned 200 total points
ID: 18862628
actually these are 2 script s you need: one for encryption and one for cron

> . but I'm not sure of the most efficient way to do this in php ..
I guess you better do it with a shell, or switch to a better CGI language (perl, python, java, not sure for ruby) which support libs for compression and encryption. The cron still will be a simple shell.
0

Featured Post

Automating Your MSP Business

The road to profitability.
Delivering superior services is key to ensuring customer satisfaction and the consequent long-term relationships that enable MSPs to lock in predictable, recurring revenue. What's the best way to deliver superior service? One word: automation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Businesses who process credit card payments have to adhere to PCI Compliance standards. Here’s why that’s important.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question