Brian, That's great - thank you! I've made the change and that's just what I'm after.
Regards On Thursday, 11 June 2015 15:25:38 UTC+1, Colin Phillips wrote: > > All, > > I'm currently trying to compose a playbook to remove log files that are > older than 90 days and then gzip the remaining files that are older than 7 > days. > > I'm attempting to use the cron module of Ansible to do this but havign a > bit of trouble. > > Here's what I've done so far: > > Created a job in my main.yml file > > - name: Cron job to purge log files older than 90 days and gzip files on > a daily rotation > cron: minute="59" hour="23" weekday="*" > name="freeradius log file rotation" > cron_file="freeradius" > user="root" > job="/etc/cron.d/freeradius" > tags: > - cronradius > > > > > > > My cron_file (freeradius) looks like this: > > find /var/log/freeradius/radacct/ -mtime +90 -print0 | xargs -0 rm && > find /var/log/freeradius/radacct/ -type f -mtime +7 -print0 | xargs -0 > gzip > > > > > When I run the playbook against a server it copies the freeradius file > across to /etc/cron.d/freeradius but when I "type" the contents of that > file it displays: > > 59 23 * * * root /etc/cron.d/freeradius > > > > and as a result I think this is incorrect, it appears to not be > referencing the find command... > > Any ideas what I am doing wrong? > > Regards > Colin > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d8f667d4-34c9-43e0-a6ed-52ff16fb4f31%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
