Solved

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

Posted on 2007-04-03
4
369 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 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
i am unable to add data to mysql database 6 55
How do I fix this error with quotation marks? 4 27
PHP Curl Problem 10 42
bitlocker- locked out 8 23
There are many Password Managers (PM) out there to choose from. PM's can help with your password habits and routines, but they should not be a crutch you rely on too heavily. I also have an article for company/enterprise PM's.
Ransomware is a growing menace to anyone using a computer or mobile device. Here are answers to some common questions about this vicious new form of malware.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decadeā€¦

696 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