I have a cron job which unzips a file and executes it. The cron is set to unzip, execute and delete the .zip file after. It's executing fine but it's not deleting the file. Here's the cron:
/usr/bin/wget -q -nd --delete-after 'url of plugin to execute the file'
I tried to add a second cron which would delete the files that are older than 15 days from the folder but this seems to "bother" the first cron to execute properly.
The second cron I used was:
/usr/bin/find /directory/ -mtime +15 -exec /bin/rm {} \; > /dev/null 2>&1
wgetline that actually executes anything.--delete-afteris really not indented for what you are trying to use it for - see the man page. – didster Oct 17 '12 at 20:32wgetman page and study the meaning of--delete-after. It deletes all downloaded files immediately after downloading them; it doesn't give you a chance to do anything with them. (It's useful for pre-fetching pages through a proxy.) – Keith Thompson Dec 16 '12 at 22:02