Skip to content

HybridShivam/php-zipper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zipper

Configuration for apache on Ubuntu. [ Assuming the project is at DocumentRoot/zipper ]

Install php-zip mod and enable it:

sudo apt-get install php-zip
sudo phpenmod zip
sudo service apache2 restart

Make sure all files are owned by the Apache group and user. In Ubuntu it is the www-data group and user:

sudo chown -R www-data:www-data /var/www/html/zipper/userUploads/

Next enable all members of the www-data group to read and write userUploads/ files:

sudo chmod -R g+rw /var/www/html/zipper/userUploads/

CleanScript CronJob

vi /home/ubuntu/scripts/cleanUpOldUploads.sh

#!/bin/sh
touch log.txt;
whoami >> log.txt;
find /var/www/html/zipper/userUploads -type f ! -name '.doNotDeleteMe' -mmin +1440 -exec rm -r {} \;
find /var/www/html/zipper/userUploads -type d -empty -delete;
echo " Time: $(date -Iseconds) : Run Again" >> log.txt;

chmod +x /home/ubuntu/scripts/cleanUpOldUploads.sh

crontab -e

Add this line at the end:

0 0 * * * /home/ubuntu/scripts/cleanUpOldUploads.sh

About

Developed in 2019

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published