Re: (Fwd) Re: Informix Message Log
Posted in 1996
}
} Ravi Joseph Pinto (ravi@in.DHL.COM) wrote:
} : Hi,
}
} : I am not sure if the first posting made thru !!!
Yes it did.
}
} : Ravi...
} : On 30 Jul 96 , Richard Thomas <r.thomas@csl.gov.uk> wrote
}
} : } log is just one file, you don't even need tar - just move (mv) the
} : } file, renaming it using the date command.
} : }
} : } eg
} : }
} : } #!/bin/sh
} : } cd /online (subbstitute your own $INFORMIXDIR here)
} : } mv online.log log_archive/`date '+%d-%m-%y'`
}
} : Shouldn't the OnLine be shutdown before moving the message file to
} : archive area , keeping in mind that oninit / tbinit is constantly writing to
} : the file ???
}
} Well, oninit isn't "constantly" writing to this file. (Unless you've got
} some serious problem going on.) The file gets opened, written to, and closed
} each time a message is written. So the file shouldn't usually be open.
}
There is still the risk that the file will be being written to during your
mv. Which is why I prefer:
tdy=`date +"%Y%j"`
cp $logfile $logfile.$tdy
cat /dev/null > $logfile
The file is never 'gone' that way. Sure an 'mv' to the same file system
is going to take a millsecond - so it's probably never going to be an issue.
Sure a 'cp' is slower.
cheers
j.
_____________________________________________________________________________
Jack Parker - Hewlett Packard, DMD/IS Boise, Idaho, USA
jparker@boi.hp.com Currently on loan to PLD/PE
_____________________________________________________________________________
If anything can go wrong, fix it. To hell with Murphy.
_____________________________________________________________________________
Any opinions expressed herein are my own and not those of my employers.
_____________________________________________________________________________