Linux-admin Development Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: urgrue <urgrue@tumsan.fi>
To: linux-admin@vger.kernel.org
Subject: simple scripting question
Date: Mon, 27 Jan 2003 11:58:28 +0200	[thread overview]
Message-ID: <20030127095828.GA23742@fede2.tumsan.fi> (raw)

i have several dirs and i want to delete the ones that are older than 
60 days.
currently im doing it like this:
find /path/backups-*  -type d -mtime +60 | xargs rm -r

but i dont want to go through the CONTENTS of the dirs and delete every 
individual file that is older than 60d. i want to either delete or not 
delete the whole dir depending on its timestamp.

but i only know of find that accepts something as spiffy as -mtime +60, 
and i cant find any options for it like "--non-recursive".

any suggestions?
basically this is for removing outdated backups.

             reply	other threads:[~2003-01-27  9:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-27  9:58 urgrue [this message]
2003-01-27 13:06 ` simple scripting question Glynn Clements
2003-01-28  2:03 ` Mikhail Romanenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030127095828.GA23742@fede2.tumsan.fi \
    --to=urgrue@tumsan.fi \
    --cc=linux-admin@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox