In this blog, I will be demonstrating a program object to automate the process of back up of the log files generated by BO servers and free the disk space used by logs in default BO logging directory. It helps to investigate root cause for server issues as the log files are organized efficiently
Prerequisites:
Creation of a Java Program Object:
import java.io.File;
import java.io.*;
import com.crystaldecisions.sdk.plugin.desktop.program.*;
import com.crystaldecisions.sdk.framework.*;
import com.crystaldecisions.sdk.occa.infostore.*;
import com.crystaldecisions.sdk.exception.*;
public class MoveLogFiles implements IProgramBase {
public void run(IEnterpriseSession enterprisesession,IInfoStore iStore,String str[]) throws SDKException
{
File file = new File(str[0]);
System.out.println("Checkpoint1");
String[] myFiles;
if(file.isDirectory()){
System.out.println("cHECKpOINT2");
myFiles = file.list();
for (int i=0; i<myFiles.length; i++) {
File myFile = new File(file, myFiles[i]);
System.out.println(myFile.getName());
File afile = new File(str[0] +"\\"+ myFile.getName());
System.out.println(afile);
afile.renameTo(new File(str[1] + "\\" + myFile.getName())) ;
System.out.println(new File(str[1] + "\\" + myFile.getName()));
System.out.println("Suceeded");
}
}
}
}
http://help.sap.com/businessobject/product_guides/boexir4/en/xi4_boejava_dg_en.zip
http://help.sap.com/businessobject/product_guides/boexir31/en/boesdk_java_dg_12_en.zip
Publishing the Java Program Object to the Enterprise System:
It takes two arguments as path for directories starting with the source directory (BO default logging dir path) followed by destination directory (Archive directory). For example, “D:\BusinessObjects\Logging” “D:\Backup”
Following two scenarios are applicable here:
In this scenario you can specify the cache directory path in the usual format e.g. C:\Program Files (x86)\Business Objects\logging
b. BO Logging directory is hosted on a remote server or SAN Disk:
In this scenario you can specify the cache directory path in the UNC syntax for windows i.e. \\server\share\file_path
e.g. \\172.198.101.11\C$\Program Files (x86)\Business Objects\logging
Note: The account on which BO services are running must have required access on the remote box in order to perform the read/write/delete operation
7. Test "Run Now" and schedule the Program Object.
Upon successful execution of the program objects log files are moved from the logging directory to the back up directory.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |