Solved

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

Posted on 2007-04-03
4
364 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
4 Comments
 
LVL 19

Accepted Solution

by:
Michael701 earned 300 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 100 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 100 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now