Question

I am going to be using a CRON job to run everyday and find year old videos, then using PHP I want to delete them. However PHP only has access to the /web directory and the videos are stores much farther back in the directory tree.

We have used a symlink to create a directory within the /web so we can view them in our FTP clients, but like I said before PHP can't access it because it has limited access. I don't want to allow PHP full access to the server because I see that as very very unsafe if a hacker were to ever gain access.

So how should I go about deleting these files automatically?

Thanks.

Was it helpful?

Solution

Why not use a shell script to remove the files?

How to write/execute shell script: https://superuser.com/questions/81262/how-to-execute-shell-script-via-crontab

Shell command to remove files: http://www.howtogeek.com/howto/ubuntu/delete-files-older-than-x-days-on-linux/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top