Skip to content

Instantly share code, notes, and snippets.

@khalid-s
Created June 27, 2016 18:16
Show Gist options
  • Select an option

  • Save khalid-s/392eeefed6aa4302e8821aa74652073f to your computer and use it in GitHub Desktop.

Select an option

Save khalid-s/392eeefed6aa4302e8821aa74652073f to your computer and use it in GitHub Desktop.
A small bash to clear symfony cache regularly on a unix based system. This can be coupled with crontab and you can configure the delay and path to folder
#!/bin/bash
delay=1 #In minutes
folderToManage=var/cache/**/*
find $folderToManage -type f -mmin +$delay -delete
find . -empty -type d -delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment