On Sun, 1 Jan 2006, Udi Mottelo wrote:
On Thu, 29 Dec 2005 bernard(_dot_)schoenacker(_at_)free(_dot_)fr wrote:
hi,
I seek a solution to define this expression for create a tree
folder with in procmailrc :
hour ( hh;mm;ss )
day ( hours;min; day;month;yyyy )
week ( week 1 to 52 yyyy )
half-month # definition wanted
month ( date +%m-%Y )
quater # definition waned
half-year # definition wanted
year (
archive folder tree
$YEAR #
|=> $ HALF-YEAR #
|=> $QUARTERLY ( 1/ 2/ 3/ 4/ ) # ( springs; summer;... )
|=> $MONTHLY # ( from 1°/31 except february )
|=> $HALF-MONTH #
|=> $WEEKLY ( 7Days ) # ( 1 to 52 weeks / year )
|=> $TODAY #
|=> $HOURLY ##*
*
## become other foreign syslog with heavy traffic activity
momently, i have :
YEARFOLDER =` ` #
"HALF-YEAR" = ' ' # need help for definition
QUARTER = ' ' # need help for definition
I guess that you will do the QUARTER:
date '+%j' | awk '$1<=91{print "1";exit};$1<=182{print "2";exit}...'
If you are good in math you will be able to calculate by awk(1)
or bc(1). Just for example:
echo "365 % `date '+%j'`" | bc
will give you the reminder. The same in awk:
date '+%j' | awk '{print 365%$1}'
Sorry I'm so bad in math that I don't know the right form
to make the output 1,2,3,4 from 365 div DAY, but I'm sure
it's possible.
OK. after slipping on the problem, here you are:
date '+%j / 91 + 1' | bc
This command will give you the QUARTER that you want to.
Bye,
Udi
Bye,
Udi
MONTHFOLDER = ' ' ## definition From ISO/DIN norm
HALF-MONTH = ' ' # need help for definition
WEEK = ' ' # need help for definition
TODAY = ' ' #
HOUR = ' ' #
and create folders ( sample ) :
echo -e ':0 ic\n * ? test ! -d
$HOME/Mail/$YEARFOLDER/$HALF-YEAR/$QUARTER/$MONTHFOLDER/$HALF-MONTH/$WEEK/$TODAY/$HOUR
\n | mkdir -p
$HOME/Mail/$YEARFOLDER/$HALF-YEAR/$QUARTER/$HALF-MONTH/$MONTHFOLDER/$HALF-MONTH/$TODAY/$HOUR
&& chmod 0700
$HOME/Mail/$YEARFOLDER/$HALF-YEAR/$QUARTER/$MONTHFOLDER/$HALF-MONTH/$WEEK/$TODAY/$HOUR
\n\n '>>.procmail &&
And wish to all member from this mailing-list a friendly Happy New Year (
Prosit
Neues Jahr und " Gute Rutsch " )
kindest regard
bernard schoenacker
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail
+++++++++++++++++++++++++++++++++++++++++++
This Mail Was Scanned By Mail-seCure System
at the Tel-Aviv University CC.
---------------------------------------------------------------------------
Udi Mottelo - Unix System Administrator.
Faculty of Engineering - Tel-Aviv University
E-Mail: <uuddii(_at_)eng(_dot_)tau(_dot_)ac(_dot_)il> Phone: +972-3-6409446
PGP/GPG public-kye: http://www.eng.tau.ac.il/~uuddii/pgp/public.asc
---------------------------------------------------------------------------
+++++++++++++++++++++++++++++++++++++++++++
This Mail Was Scanned By Mail-seCure System
at the Tel-Aviv University CC.
---------------------------------------------------------------------------
Udi Mottelo - Unix System Administrator.
Faculty of Engineering - Tel-Aviv University
E-Mail: <uuddii(_at_)eng(_dot_)tau(_dot_)ac(_dot_)il> Phone: +972-3-6409446
PGP/GPG public-kye: http://www.eng.tau.ac.il/~uuddii/pgp/public.asc
---------------------------------------------------------------------------
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail