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

Popular posts from this blog

download - Firefox cannot save files (most of the time), how to solve? - Super User

windows - "-2146893807 NTE_NOT_FOUND" when repair certificate store - Super User

sql server - "Configuration file does not exist", Event ID 274 - Super User