Giter VIP home page Giter VIP logo

ansible-tidy's Introduction

ansible-tidy

Tidy module for Ansible, inspired by Puppet's tidy module. Remove unwanted files based on specific criteria.
Multiple criteria are AND’d together

New in version: 1.7

parameter required default choices comments
age no 0
    Tidy files whose age is equal to or greater than the specified time. You can choose seconds, minutes, hours, days, or weeks by specifying the first letter of any of those words (e.g., ‘1w’). Specifying 0 will remove all files.
    force no
    • yes
    • no
    Force removal of non empty directories
    matches no
      One or more (shell type) file glob patterns, which restrict the list of files to be tidied to those whose basenames match at least one of the patterns specified. Multiple patterns can be specified using a list.
      path yes
        Path to the file or directory to manage. Must be fully qualified.
        recurse no no
        • yes
        • no
        If target is a directory, recursively descend into the directory looking for files to tidy.
        rmdirs no no
        • yes
        • no
        Tidy directories in addition to files; that is, remove directories whose age is older than the specified criteria. This will only remove empty directories, so all contained files must also be tidied before a directory gets removed.
        silent no no
        • yes
        • no
        Silently ignore failed commands.
        size no 0
          Tidy files whose size is equal to or greater than the specified size. Unqualified values are in bytes, but b, k, m, g, and t can be appended to specify bytes, kilobytes, megabytes, gigabytes, and terabytes, respectively. Size is not evaluated for directories.
          timestamp no atime
          • atime
          • mtime
          • ctime
          Set the mechanism for determining age. Default is atime.
          • Examples:
          # Recursively delete on /tmp files older than 4 weeks
          - tidy: path="/tmp" age="4w" recurse=yes
          
          # Recursively delete on /tmp files older than 4 weeks and equal or greater than 1 megabyte
          - tidy: path="/tmp" age="4w" size="1m" recurse=yes
          
          # Recursively delete on /var/tmp files and empty directories with last access time greater than 3600 seconds
          - tidy: path="/var/tmp" age="3600" timestamp=atime rmdirs=yes recurse=yes
          
          # Delete on /var/log files equal or greater than 10 megabytes ending with .log or .log.gz
          - tidy: path="/var/tmp" matches="*.log","*.log.gz" size="10m"
          

          ansible-tidy's People

          Contributors

          rmarchei avatar dazwin avatar

          Watchers

          James Cloos avatar  avatar

          Recommend Projects

          • React photo React

            A declarative, efficient, and flexible JavaScript library for building user interfaces.

          • Vue.js photo Vue.js

            🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

          • Typescript photo Typescript

            TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

          • TensorFlow photo TensorFlow

            An Open Source Machine Learning Framework for Everyone

          • Django photo Django

            The Web framework for perfectionists with deadlines.

          • D3 photo D3

            Bring data to life with SVG, Canvas and HTML. 📊📈🎉

          Recommend Topics

          • javascript

            JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

          • web

            Some thing interesting about web. New door for the world.

          • server

            A server is a program made to process requests and deliver data to clients.

          • Machine learning

            Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

          • Game

            Some thing interesting about game, make everyone happy.

          Recommend Org

          • Facebook photo Facebook

            We are working to build community through open source technology. NB: members must have two-factor auth.

          • Microsoft photo Microsoft

            Open source projects and samples from Microsoft.

          • Google photo Google

            Google ❤️ Open Source for everyone.

          • D3 photo D3

            Data-Driven Documents codes.