[opencms-dev] Backup a module in specific time intervals

Pantelis Soultanakis psou at eurocom.gr
Fri Dec 10 13:25:38 CET 2004


Hello, I am trying to find out how to backup my modules in regular time intervals. For example, in order to backup other resources I use Scheduled Tasks to instantiate an object that backups my resources. The code of the class that performs the backup is as follows:
 
--------------------------------------------------------------------------------------
 public class EXTRANETBackup implements I_CmsCronJob {
 
    public String launch(CmsObject cms, String parameter) throws Exception {
 

    //get the path to export data
    String rootPath = cms.readProperty("/ING-EXTRANET/ADMIN/BACKUP/admin_backup","Title").toString();//"c:/backup/opencms/ing/";
    if (rootPath==null || "".equals(rootPath))
    {
      rootPath="c:/";
    }
    // set all paths for static export
    String[] pathArray = new String[] {
                         "/EXTRANET/",
                         "/system/galleries/pics/EXTRANET-image-gallery/"};
 
    // get date for filename extension
    Calendar today = Calendar.getInstance();
    today.setTime(new Date());
    int day_of_week = (today.get(Calendar.DAY_OF_WEEK));
 
    String fileName = rootPath + day_of_week;
 
    boolean includeSystem = true; // include system folder?
    boolean incremental = false; // full or incremental backup
 
    // start export of choosen recources
    cms.exportResources(fileName,pathArray,includeSystem,incremental);
---------------------------------------------------------------------
Can you please give me a tip on how to backup my modules in specific time intervals?
 
Thank you
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20041210/8780b468/attachment.htm>


More information about the opencms-dev mailing list