|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: multiple symbolic links....?
This is more of a *nix thing that a cronolog thing - unless I've got the
wrong end of the stick.
I imagine you want /var/log/log.old to point to last months log, and
/var/log/log.new to point to this months (and this changes every month)...
What I would do, is write a perl script along the lines of:
------------------------------------------------------------------
#!/path/to/perl
$month = getthismonth(); # write this function
$year = getyear(); # write this function
system ("\ln -s /logs/$year/$month/logfile.log /var/log/log.new");
if (--$month == 0) {
$year--;
$month = 12;
}
system ("\ln -s /logs/$year/$month/logfile.log /var/log/log.old");
------------------------------------------------------------------
and stick this in a crontab like:
------------------------------------------------------------------
# run script at midnight on 1st of every month:
0 0 1 * * /path/to/script
------------------------------------------------------------------
I'd check on the syntax (just woke up) but I hope this helps.
Ben Dimmock
Systems Software Engineer
--
Reality42: 12 Furber Street, London, W6 0HE, UK
Telephone: +44.70.9212.1874
Facsimile: +44.70.9218.0488
E-mail : mailto:ben@xxxxxxxxxxxxx
Web site : http://reality42.net
-----Original Message-----
From: owner-cronolog-users@xxxxxxxxxxxxxxxxxx
[mailto:owner-cronolog-users@xxxxxxxxxxxxxxxxxx]On Behalf Of Joseph
Nadler
Sent: 11 January 2001 06:03
To: cronolog-users@xxxxxxxxxxxxxxxxxx
Subject: multiple symbolic links....?
Hey!
Anybody know if it's possible to have cronolog link multiple months to one
directory? e.g. -
/logs/2000/12/logfile.log -> /var/log/log.old
/logs/2001/01/logfile.log -> /var/log/log.new
Anyone? :-)
Joseph Nadler
joseph@xxxxxxxxxxxxxxxxxxxx
Solutions Central
Level 5, 96 Albert street
Po Box 440
Albert Street BC 4002
Ph: 3307 6666
Fax: 3307 6600
|