I have a directory that gets filled with images from a web service and the images only need to exist on my server for 5 minutes after they've been placed. I tried using tmpreaper
but I couldn't get it to work. I did the following command:
sudo crontab -e
* * * * * tmpreaper 5m /my_image/dir
I checked that the cron
was running by pgrep cron
and I got a PID
. However, the images are still in the directory. Running the command manually works perfectly fine, however it's not working through cron.