cron - Deleting 5 minute old files every minute? - Ask Ubuntu
i have directory gets filled images web service , images need exist on server 5 minutes after they've been placed. tried using tmpreaper
couldn't work. did following command:
sudo crontab -e
* * * * * tmpreaper 5m /my_image/dir
i checked cron
running pgrep cron
, got pid
. however, images still in directory. running command manually works fine, it's not working through cron.
in experience, cron doesn't raw commands in files. make simple bash script looks like:
#!/bin/bash tmpreaper 5m /my_image/dir
save script somewhere solid, make executable, , change cron bash /path/to/script
.
i've had issues permissions cron well. make sure being run correct user expecting to.
Comments
Post a Comment