Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I delete files from cache dir as ordinary user? #115

Open
StefanGlaesser opened this issue Apr 11, 2019 · 1 comment
Open

How can I delete files from cache dir as ordinary user? #115

StefanGlaesser opened this issue Apr 11, 2019 · 1 comment

Comments

@StefanGlaesser
Copy link

The cache directory is owned by www-data:www-data and has initial rights of 0777. Each subfolder has rights of 0755 and is also owned by www-data:www-data. I have an ordinary user which also belongs to the www-data group, but I'm not able to delete files from that directory. So I have the following situation:

$ ls -al
total 32
drwxr-xr-x 2 www-data www-data  4096 Apr 11 19:09 .
drwxr-xr-x 3 www-data www-data  4096 Apr 11 19:09 ..
-rw-r--r-- 1 www-data www-data 20817 Apr 11 19:09 48775fdc58830aef06bf75353c3bae8041df60a8.jpg

So when trying to delete those file I got:

$ rm 48775fdc58830aef06bf75353c3bae8041df60a8.jpg 
rm: remove write-protected regular file '48775fdc58830aef06bf75353c3bae8041df60a8.jpg'? y
rm: cannot remove '48775fdc58830aef06bf75353c3bae8041df60a8.jpg': Permission denied

So how can I setup the cache_directory that I can remove those files? I have some commands which are run by the ordinary user but those commands break down because some files of the image_cache directory can't be deleted/refreshed.

Best regards,
Stefan

@Gregwar
Copy link
Owner

Gregwar commented Apr 12, 2019

Hello,

That is the purpose of the GarbageCollector (cleaning old files)
I suggest you try to run the demo/gc.php script, that will delete files older than 5 days for instance

You can also consider passing -1 to the days parameters to delete all the files and not only the older ones

Are you hosting your website on a dedicated server or standard hosting ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants