Hello,
using the Version 6.3.1
I found one, but it did not work. http://wiki.openkm.com/index.php/Scripting_-_OpenKM_6.2 ( Cron tab exporter )
In the Log file: /opt/openkm-6.3.1-community/tomcat/logs/CrontabRepositoryExporter_20151023.log
i find this 2 lines
using the Version 6.3.1
I found one, but it did not work. http://wiki.openkm.com/index.php/Scripting_-_OpenKM_6.2 ( Cron tab exporter )
Code: Select all
Error:import com.openkm.util.FileLogger;
import com.openkm.bean.ContentInfo;
import com.openkm.api.*;
import com.openkm.util.impexp.*;
import java.io.*;
import java.text.*;
import com.openkm.core.Config;
import java.util.*;
// Configuration parameters
String LOG_FILE_NAME = "CrontabRepositoryExporter";
String repoPath = "/okm:root";
String fsPath = "/var/backups";
boolean metadata = false;
boolean history = false;
// Start
FileWriter fw = null;
try {
FileLogger.info(LOG_FILE_NAME, "Started");
// Open outputstream
String fileDate = new SimpleDateFormat("yyyyMMdd").format(new Date());
String fileName = Config.LOG_DIR + File.separator + LOG_FILE_NAME + "_" + fileDate + ".log";
File file = new File(fileName);
fw = new FileWriter(file);
// Starting the process
ContentInfo cInfo = OKMFolder.getInstance().getContentInfo(null, repoPath);
FileLogger.info(LOG_FILE_NAME, "Files & directories to export:"+(cInfo.getDocuments() + cInfo.getFolders()));
File dir = new File(fsPath);
ImpExpStats stats = RepositoryExporter.exportFolder(null, repoPath, dir, metadata, history, fw, new HTMLInfoDecorator((int)
cInfo.getDocuments() + (int) cInfo.getFolders()));
FileLogger.info("CrontabRepositoryExporter", "Finished");
} catch (Exception e) {
if (fw!=null) {
try {
fw.close();
} catch (IOException e1) {
}
}
}Code: Select all
If i comment out the Line:bsh.EvalError: Sourced file: inline evaluation of: ``import com.openkm.core.Config; import com.openkm.servlet.admin.BaseServlet; im . . . '' Token Parsing Error: Lexical error at line 33, column 59. Encountered: "\r" (13), after : "\"Files & directories to" : at Line: 20 : in file: inline evaluation of: ``import com.openkm.core.Config; import com.openkm.servlet.admin.BaseServlet; im . . . '' : FileWriter fw = nullCode: Select all
then there is no error message, but no export is created// ImpExpStats stats = RepositoryExporter.exportFolder(null, repoPath, dir, metadata, history, fw, new HTMLInfoDecorator((int) cInfo.getDocuments() + (int) cInfo.getFolders()));In the Log file: /opt/openkm-6.3.1-community/tomcat/logs/CrontabRepositoryExporter_20151023.log
i find this 2 lines
Code: Select all
Thanks2015-10-23 07:57:57,233 INFO Files & directories to export:68
2015-10-23 07:57:57,233 INFO Finished
Last edited by ds2k15 on Fri Oct 23, 2015 9:21 am, edited 1 time in total.
