Question : Truncate a Log File

I am new to adaptive server anywhere, I have a log file that I want to trunacte is there a tool in sybase central that can do that

Answer : Truncate a Log File

Hi,

I occurs to me that you asked us about truncating the Log File.  I am think now that you meant the text file that is produce by Sybase for Information and error messages about your running server.  Follow the instructions below to download and install.  Then  in a cmd window run the following
copy srv_log_file.log srv_log_file_archive.log
"tail -1000 srv_log_file.log > srv_log_file_trim.log" - this takes the last (tail) 1000 lines adjust this number as desired
review and make sure you have the information/error messages for the time period you desire
"copy srv_log_file_trim.log srv_log_file.log"

knel


SUMMARY: Display the most recent results of a log file with the tail command for Windows XP.
 
The tail command, on most Unix-style operating systems, lets you display the last 10 or so lines of a text file. It also supports a feature allowing you to keep a file lock on a particular file, displaying new lines as they appear. This is most commonly used for displaying the results of log or debug files, letting you see only the most recent activity of a particular process.

While Windows XP does not normally come with a 'tail' tool, it is available in the Windows 2003 Resource Kit. It is a large download, but besides the 'tail' command, the Windows 2003 Resource Kit also provides tools to remap keys, query the Active Directory, and more. To download and install the Resource Kit:

1. Go to the Microsoft Windows Server 2003 download section at http://www.microsoft.com/windowsserver2003/
downloads/tools/default.mspx. Or, if that link does not work, visit http://www.microsoft.com/ and search for "Windows 2003". Once there, choose the "Downloads -> Tools" link.

2. Select the link "Windows Server 2003 Resource Kit Tools".

3. Click the "Download" link. Choose to register or not, depending on your choice, and follow the on-screen instructions to download and install the product. The default install directory is "C:\Program Files\Windows Resource Kits\Tools\".

Once the Windows 2003 Resource Kit is installed, you may need to reboot your machine for the directory "C:\Program Files\Windows Resource Kits\Tools\" to be added to your path.

Now that the tail command is available, to see the online help, enter the following DOS command:

tail /?
Random Solutions  
 
programming4us programming4us