From: Harry Putnam <reader@newsguy.com>
Subject: Re: Archiving large NNML groups quickly.
Date: Tue, 30 Oct 2001 14:37:11 -0800 [thread overview]
Message-ID: <m1snc0oltb.fsf@reader.newsguy.com> (raw)
In-Reply-To: <Pine.LNX.4.33.0110301018260.25397-100000@slipsten.extundo.com> (Simon Josefsson's message of "Tue, 30 Oct 2001 10:23:05 +0100 (CET)")
Simon Josefsson <jas@extundo.com> writes:
> On Tue, 30 Oct 2001, Daniel Pittman wrote:
>
>> Now that the NNML marks, et al, are set up so that NNML groups are
>> independent, is it possible for me to quickly move my current
>> linux-kernel archive to a backup by doing...
>>
>> ] cd ~/Mail && mv linux.kernel linux.kernel.1
>>
>> ...when Gnus is not running? I think this should just work and I will
>> get a new group linux.kernel.1 and all, but I wanted to check...
>
> You need to unsubscribe to the old group, and subscribe to the new one
> within Gnus, but other than that I think it would work. Hm, I think nnml
> notices new groups automagically if they are part of the active file,
> maybe you can use "echo linux.kernel.1 0 1 0 y >> active" to do everything
> from the cmd line. IMHO the active file should be eliminated, and a
> ".active" file in each nnml group should be used instead.
I've experimented with this a little and this looks like at least one
good way to do it from command line ( a helper tool is included).
1)
cp -R ~/Mail/target ~/Mail/target.1
2)
Get the highest and lowest message numbers in "target.1 and add this entry
to ~/Mail/active: "target.1 high_num low_num y
(A homeboy scritp included to extract that information)
3)
Two techniques available here
a. In a running gnus go to server buffer. Press <RET> on
nnml (or whatever) server. Subscribe to target.1
4)
Back in group buffer press `g' before entering the new group
NOTE:
This method seems to maintain any marks that were in "target".
Helper script:
For usage type "add_active help" but in general:
add_active -d <no args> - display most of the variables inside the script
add_active -s GROUP - Shows what will be appended.
add_active -w GROUP - Write the data to ~/Mial/active
(Note: -w flag causes a backup copy of ~/Mail/active to be
written to ~/Mail/active_MNTHDAYHOURMINSEC before writing)
(NOTE: Beware of lightly tested script)
cat add_active
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#!/bin/sh
# Keywords: add_active - insert an entry into Gnus ~/Mail/active file
# key Date: Oct 30 2001 2
# &&
## BEGIN DOCUMENTATION[S] ======================================
usage () {
cat >&2 <<EOM
Purpose: Append entry to Gnus ~/Mail/active file containing
highest and lowest messagge number like: "GROUP HI LO y"
Usage: \`$(basename $0) -[dsw] GROUP <-s -w> require an argument
(Note: do not include path with GROUP)
-d - <no args allowed> display most of the variables inside
this script.
-s - <requires a GROUP arg> Show what the results would be
-w - <requires a GROUP arg> Writes to active file.
(Note: -w flag cause a copy of ~/Mail/active to be saved
to ~/Mail/active_$(date +"%m%d%H%M%S") before writing.
EOM
} ## end
## BEGIN SAFEGAURDS ============================================
if [ -z "$1" -o "$1" = help ];then
usage
exit
fi
## BEGIN VARIABLE[s] ============================================
AWK=/bin/awk
GROUP=$2
ACTIVE=~/Mail/active
BASE=/home/reader/Mail
ACT_ENTRY=$(ls $BASE/$GROUP |sort -n| $AWK '
NR<2{ORS=" ";last=$0}END {$FNR;print;print last " y"}')
## BEGIN GETOPTS SECTION =========================================
while getopts "ds:w:" opt; do
case "$opt" in
## Display variables
d)
$AWK '/[[:alnum:]]+=/' $0
;;
## show results
s) echo -e "$GROUP $ACT_ENTRY"
echo "Type \`$(basename $0) -w GROUP' to write it'"
;;
## Write results
w)
cp $ACTIVE "$ACTIVE"_$(date +"%m%d%H%M%S") &&
echo "$GROUP $ACT_ENTRY" >> $ACTIVE
echo -e ""$GROUP $ACT_ENTRY" written to $ACTIVE"
;;
esac
done
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
prev parent reply other threads:[~2001-10-30 22:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-30 0:05 Daniel Pittman
2001-10-30 1:49 ` Harry Putnam
2001-10-30 9:23 ` Simon Josefsson
2001-10-30 9:44 ` Kai Großjohann
2001-10-30 11:54 ` Simon Josefsson
2001-10-30 12:50 ` Kai Großjohann
2001-10-30 13:17 ` Per Abrahamsen
2001-10-30 15:58 ` Matt Armstrong
2001-11-01 15:30 ` Steinar Bang
2001-10-30 22:37 ` Harry Putnam [this message]
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=m1snc0oltb.fsf@reader.newsguy.com \
--to=reader@newsguy.com \
/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;
as well as URLs for NNTP newsgroup(s).