ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Mikhail Zabaluev <mookid@sigent.ru>
To: "mandrake-russian@linuxteam.iplabs.ru"
	<mandrake-russian@linuxteam.iplabs.ru>
Subject: [mdk-re] Re: [mdk-re] Удаление битых ссылок
Date: Sat Feb 10 14:25:22 2001
Message-ID: <20010210140012.C2112@localhost.localdomain> (raw)
In-Reply-To: <3A83B1EA.7D9B6AD8@zmail.ru>; from cornet@zmail.ru on Fri, Feb 09, 2001 at 12:01:30PM +0300

Hello cornet,

On Fri, Feb 09, 2001 at 12:01 +0300, cornet wrote:
>
> Hello!!
> 
> Волею судеб, на сервере в одном каталоге и его подкаталогах образуется
> большое количество битых символических ссылок (то есть указывающих на
> уже не_существующие файлы). Этих ссылок много и чистить их руками сильно
> ломает. Может подскажет кто простой способ автоматизации этого дела?
> Хотелось бы залудить на cron скриптик, который лез бы в вышеозначеный
> каталог и рекурсивно долбал бы все эти битые ссылки.


find <каталог> -type l -ls | awk '{ N1 = NF - 2; print $N1; print $NF }' |
    while read link && read file; do
        [ -n "${file##/*}" ] && file=`dirname $link`/$file
        [ -e "$file" ] || rm -f "$link"
    done

-- 
Stay tuned,
  MhZ                                    mailto:mookid@sigent.ru
-----------
"Be *excellent* to each other."
-- Bill, or Ted, in Bill and Ted's Excellent Adventure



  reply	other threads:[~2001-02-10 14:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-09 12:00 cornet
2001-02-10 14:25 ` Mikhail Zabaluev [this message]
2001-02-12 12:10   ` [mdk-re] " cornet
2001-02-13  9:13     ` Mikhail Zabaluev

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=20010210140012.C2112@localhost.localdomain \
    --to=mookid@sigent.ru \
    --cc=mandrake-russian@linuxteam.iplabs.ru \
    /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

ALT Linux Community general discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
		mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
	public-inbox-index community

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.community


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git