Thanks ,I had tried already and tried again but no luck .
I tried with
################
excludes:
- '*.gz'
- 'delete'
excludes:
- '*.gz'
- delete
excludes:
- '*.gz'
- "delete"
################
I also checked with other subdirectory other than directory delete if it
could clash with keyword like nitest but still not excluding it
Thanks and regards,
Nithin Subbaraj
On Wednesday, 13 January 2021 at 21:00:38 UTC+5:30 [email protected] wrote:
> On 1/13/21 4:20 PM, Nithin Subbaraj wrote:
> > Hi Racke,
> >
> > Please find the below playbook details the username and path are test
> paths
> >
> > ---
> > - name: Ansible archive Examples
> > hosts: all
> > tasks:
> >
> > - name : Find files ending with extensions
> > become: true
> > find:
> > paths:
> > - /home/nsubbaraj/replicate/vol/gunnsc01/prod/scoreout
> > recurse: yes
> > file_type: any
> > excludes:
> > - '*.gz'
> > - /home/nsubbaraj/replicate/vol/gunnsc01/prod/scoreout/delete
> > depth: 4
> > age: 7d
> > age_stamp: mtime
> > register: output
> >
> > - name: archive the files
> > become: yes
> > archive:
> > remove: yes
> > path: "{{ item.path }}"
> > dest: "{{ item.path
> }}-{{ansible_date_time.date.replace('-','')}}.gz"
> > format: zip
> > with_items: "{{ output.files }}"
> >
> > ##############################
> >
> > I am able to exclude the gzip files but not the delete directory files
> under
> > /home/nsubbaraj/replicate/vol/gunnsc01/prod/scoreout/
>
> I think the values for "excludes" need to be relative to the path(s), so
> try "delete"
> instead of "/home/nsubbaraj/replicate/vol/gunnsc01/prod/scoreout/delete".
>
> Regards
> Racke
>
> >
> > On Wednesday, 13 January 2021 at 20:38:41 UTC+5:30 [email protected]
> wrote:
> >
> > On 1/13/21 3:58 PM, Nithin Subbaraj wrote:
> > >
> > > I have created an ansible playbook which finds files older than 7 days
> and zips the files.
> > > Also trying to exclude files from particular directory but not able
> to find.
> > >
> > > I am not able to the exclude the files under sub directory ,it is also
> getting zipped
> > > I am able to successfully exclude the already zipped files but not a
> sub directory under the path
> > >
> > > using excludes in find module for compressing files older than 7 days
> >
> > Please share your playbook.
> >
> > Regards
> > Racke
> >
> > >
> > > --
> > > 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] <mailto:
> [email protected]>.
> > > To view this discussion on the web visit
> > >
> https://groups.google.com/d/msgid/ansible-project/0378a412-1a74-48d2-875a-45ccff472a8cn%40googlegroups.com
> > <
> https://groups.google.com/d/msgid/ansible-project/0378a412-1a74-48d2-875a-45ccff472a8cn%40googlegroups.com
> >
> > >
> > <
> https://groups.google.com/d/msgid/ansible-project/0378a412-1a74-48d2-875a-45ccff472a8cn%40googlegroups.com?utm_medium=email&utm_source=footer
> > <
> https://groups.google.com/d/msgid/ansible-project/0378a412-1a74-48d2-875a-45ccff472a8cn%40googlegroups.com?utm_medium=email&utm_source=footer
> >>.
> >
> >
> >
> > --
> > Ecommerce and Linux consulting + Perl and web application programming.
> > Debian and Sympa administration. Provisioning with Ansible.
> >
> > --
> > 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] <mailto:
> [email protected]>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/ansible-project/8882fa97-8657-486e-99a3-fbd7a5e964d2n%40googlegroups.com
> > <
> https://groups.google.com/d/msgid/ansible-project/8882fa97-8657-486e-99a3-fbd7a5e964d2n%40googlegroups.com?utm_medium=email&utm_source=footer
> >.
>
>
> --
> Ecommerce and Linux consulting + Perl and web application programming.
> Debian and Sympa administration. Provisioning with Ansible.
>
>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/c76f161c-27d6-47d1-a459-ef6db6b4aa1an%40googlegroups.com.