Remove Old Log Files...

Trying to remove schedule task's old log files but getting permission denied error. There are 100+ log files @ var/log which we need to remove but not successful.

Any suggestion?

Please help.

On your end, you could just use

echo '' > /var/log/logfile

to clear out the file contents.

But to actually delete the files, we would have to do that for you as of right now. Would you like us to delete all scheduled task log files except for the most recent one?

Thanks for the prompt response...

We already executed the command... But Please remove the logs from your end.

I'm not sure if I should have opened a new thread, but I am having the same issue. My webapp has two log files, one for the naked URL and one for www. I would like the ones for the naked URL removed please.

We have a new api endpoint that allows you to remove these logfiles if they are not currently being used by webapps etc. Check out the documentation, get an api token, start a new console, and try to send a DELETE request to{username}/files/path{path}/

I tried the code below, but it doesn't seem to be working. I'm not too familiar with HTTP methods. Could you provide a little guidance about what I'm doing wrong?

curl --request DELETE --header "Authorization: OAuth PASTED_MY_TOKEN_HERE" http://www.pythonanywhere. com/api/v0/user/0p3r4t0r/files/path/var/log/

  1. use https (otherwise anyone listening to your traffic can steal your token! perhaps get a new token if you want to be safe)
  2. what error do you get back when you do that curl?
  3. shouldn't it be Authorization: Token YOURTOKEN?

That did the trick, thanks. It was late at night and I was stuck on old habits. Good call on using https:

Thanks for all of your help. I always appreciate the support of the python anywhere community!

Glad we could help :-)