GithubHelp home page GithubHelp logo

imranansari / rm-rotated-files Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sixarm/rm-rotated-files

0.0 2.0 0.0 6 KB

Remove rotated log files: files that are compressed, or numbered, or datestamped, e.g. syslog.1, history.gz, etc.

Home Page: http://sixarm.com/rm-rotated-files

Shell 100.00%

rm-rotated-files's Introduction

Remove rotated files

This script deletes log files that are created by various kinds of log file rotations.

Contents:

Introduction

Syntax:

$ rm-rotated-files <dir>

Example:

$ rm-rotated-files /var/log

Which files?

Compressed files:

  • Files with extensions that are known to be compressed or archived.

  • Examples: .bz2, .bzip, .gz, .tar, .tgz, .zip, .7zip

Old files:

  • Files with extensions that are typically for old files.

  • Examples: .old, .bak, .tmp

Numbered files:

  • Files with names that end in a separator then number:

  • Examples: foo.1, foo-2, foo_3, etc.

Datestamped files:

  • Files with names that end in a separator then ISO date.

  • Examples: foo-2017-12-31, foo_2017_12_31, etc.

Related

These scripts are for related purposes:

Compatibility notes

We prefer to be more compatible rather than system-specific.

  • To delete files, we prefer -exec rm vs. -delete. The former is more compatible, the latter is faster.

  • To regex match, we prefer patterns to be basic vs. extended. The former is more compatible, the latter is more modern.

  • We prefer POSIX code vs. shell-specific code.

  • We prefer the code to be more DAMP than DRY. For example, the code has separate name matching for .bz and .bz2, even though we could combine these.

Tracking

rm-rotated-files's People

Contributors

joelparkerhenderson avatar

Watchers

 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.