Forums

Permission denied

Dear PythonAnywere team,

Why I cannot delete the logs ?


20:14 /var/log $ ll total 1084 -rw-rw---- 1 101 registered_users 53516 Jun 30 20:12 khsadigov.pythonanywhere.com.access.log -rw-rw---- 1 101 registered_users 121241 Jun 29 15:01 khsadigov.pythonanywhere.com.access.log.1 -rw-rw---- 1 101 registered_users 84152 Jun 30 19:53 khsadigov.pythonanywhere.com.error.log -rw-rw---- 1 101 registered_users 298391 Jun 29 15:01 khsadigov.pythonanywhere.com.error.log.1 -rw-rw---- 1 101 registered_users 88503 Jun 30 20:12 khsadigov.pythonanywhere.com.server.log -rw-rw---- 1 101 registered_users 327294 Jun 30 17:48 khsadigov.pythonanywhere.com.server.log.1 -rw-rw---- 1 101 registered_users 54510 Jun 29 15:01 khsadigov.pythonanywhere.com.server.log.2.gz -rw-rw---- 1 101 registered_users 802 Jun 30 18:31 tasklog-32534-hourly-at-31-past-.home.khsadigov.189.job.py.log -rw-rw---- 1 101 registered_users 222 Jun 30 19:15 tasklog-32535-hourly-at-15-past-.home.khsadigov.189.job.py.log -rw-rw---- 1 101 registered_users 802 Jun 30 18:35 tasklog-32536-hourly-at-35-past-.home.khsadigov.189.job.py.log -rw-rw---- 1 101 registered_users 222 Jun 30 18:40 tasklog-32538-hourly-at-40-past-.home.khsadigov.189.job.py.log -rw-rw---- 1 101 registered_users 222 Jun 30 19:01 tasklog-32539-hourly-at-01-past-.home.khsadigov.189.job.py.log -rw-rw---- 1 101 registered_users 222 Jun 30 19:02 tasklog-32540-hourly-at-02-past-.home.khsadigov.189.job.py.log -rw-rw---- 1 101 registered_users 222 Jun 30 19:03 tasklog-32541-hourly-at-03-past-.home.khsadigov.189.job.py.log -rw-rw---- 1 101 registered_users 80 Jun 30 20:01 tasklog-32548-hourly-at-00-past-.home.khsadigov.189.job.py.log -rw-rw---- 1 101 registered_users 108 Jun 30 19:42 tasklog-32549-hourly-at-42-past-.home.khsadigov.189.job.py.log -rw-rw---- 1 101 registered_users 122 Jun 30 19:50 tasklog-32550-hourly-at-50-past-.home.khsadigov.189.job.py.log -rw-rw---- 1 101 registered_users 80 Jun 30 19:51 tasklog-32551-hourly-at-51-past-.home.khsadigov.189.job.py.log -rw-rw---- 1 101 registered_users 80 Jun 30 19:53 tasklog-32552-hourly-at-53-past-.home.khsadigov.189.job.py.log -rw-rw---- 1 101 registered_users 26 Jun 30 19:52 tasklog-32553-hourly-at-53-past-.home.khsadigov.189.job.py.log -rw-rw---- 1 101 registered_users 0 Jun 28 20:22 test.digimarks.com.access.log -rw-rw---- 1 101 registered_users 0 Jun 28 20:22 test.digimarks.com.error.log -rw-rw---- 1 101 registered_users 3896 Jun 28 20:23 test.digimarks.com.server.log -rw-rw---- 1 101 registered_users 0 Jun 28 20:25 test.digimarks.net.access.log -rw-rw---- 1 101 registered_users 0 Jun 28 20:25 test.digimarks.net.error.log -rw-rw---- 1 101 registered_users 0 Jun 28 20:25 test.digimarks.net.server.log 20:14 /var/log $ rm test.* rm: cannot remove ‘test.digimarks.com.access.log’: Permission denied rm: cannot remove ‘test.digimarks.com.error.log’: Permission denied rm: cannot remove ‘test.digimarks.com.server.log’: Permission denied rm: cannot remove ‘test.digimarks.net.access.log’: Permission denied rm: cannot remove ‘test.digimarks.net.error.log’: Permission denied rm: cannot remove ‘test.digimarks.net.server.log’: Permission denied

Heading

We don't allow users to create or remove files from /var/log, but you can write to the files to empty them, if you want to. Just

echo "" > /var/log/test.digimarks.net.access.log

from a bash console to do that.

But I have several unused (from old app) files. I dont need them. How they can be removed ?

Hmm, that's a good point. Send us a feedback message listing the ones you want to have deleted, and we'll do it from our side.

Hmm, do you mean that after a year I will have 365 tasklog files in my /var/log/ directory, and even more in case of hourly tasks?

Or do you rotate/remove tasklog files similar to access.log and server.log?

we logrotate them