(Ubuntu Server)

I have a folder full of files in pairs (one is a log, another is a DB backup) They are basically create/modified at the same time.

I need a shell script that detects if the folder has more than 28 or 30 files (always will be a pair), it deletes the oldest two.

What is the quickest way to do this?

Recommended Answers

All 3 Replies

None of these links really help out with the code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.