0

In my local development environment for a Laravel project I have had Clockwork installed for a few years, and after an unrelated permissions issue recently noticed that the Clockwork folder is taking up more than 1GB of data from over 100,000 JSON files:

enter image description here

Not only is this almost 50% of this project's entire web root, but the earliest files are several years old.

What does Clockwork use these files for, and is it safe to delete them without affecting its functionality?

5
  • if its in storage i think you could delete it. Not 100% sure but that json is for history where you could check previous log state . You could check the clockwork issues Commented Oct 10 at 2:32
  • github.com/itsgoingd/clockwork/issues/140 Commented Oct 10 at 2:32
  • 2
    @Mr.Kenneth That would make a perfect answer, I searched the issues and only found this recent one, possibly because I wasn't searching for "logs" - it's not clear from the JSON files that they even are logs. I can confirm a manual clockwork:clean, which took about 10 mins to run, solves the issue and the clockwork folder is now a much more sane 10MB. Commented Oct 10 at 3:09
  • glad to help... Commented Oct 10 at 7:30
  • @Mr.Kenneth Add it into an answer and I'd be happy to accept it. Commented Oct 10 at 15:02

1 Answer 1

1

AFAIK, The JSON files that you see in the storage dir are for clockworks's metadata it generates when you do any http request (get, post, api, etc). The metadata is used to view the http request state in the browser with the clockwork plugin.

Each request is 1 json file and is ignored by git.

You could do any of the following to clear the JSON files:

  1. manually delete the json files

  2. run clockwork:clean

  3. create a cron event to clear the json files

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.