Re: [opencms-dev] OpenCms backup Scheduled in the cron with export and import

Christian Steinert christian_steinert at web.de
Tue Oct 10 17:51:53 CEST 2006


Dear Maria 

you can also run a shell command from Java.
It should be enough (although I haven't tried) to create a simple opencms chronjob that does something like:

   Runtime.getRuntime().exec( "/path/to/backup_script.sh" ); 



Of course the script "/path/to/backup_script.sh" needs to have read and execute-Permission for the Tomcat user.
The shell script you would probably have to start with a line like

   #!/usr/bin/bash

so that the correct program will be used to execute it. 
If that does not work for you then you would have to dig out call the normal opencms export functionality from your own opencms-chronjob class.

hth
christian



> Thanks a lot Christian!!
> You're right!! it's a better idea. But....the problem in my case is that 
> I'm not the administrator of the machine, only I'm the opencms 
> administrator, so, it's only a competence problem.....
> But I thank you sincerently your answer!!
> Have a nice day!!
> Maria
> 
> Christian Steinert escribió:
> > Maria,
> >
> > is it not a better idea to do a complete database dump by running a scheduled job on the operating-system level?
> > with mysql a shell command like this (all on one line!) is enough to dump a complete database into a compressed SQL file:
> >   mysqldump -v --flush-logs -u <db_username> --password=<password>  <database>  | bzip2 > opencms_db_`date +%Y-%0m-%0d_%0H#%0M#%0S`.sql.bz2
> >
> > This shell command could be stored as a simple script and then be run as a daily Chronjob (at least if your server runs some flavor of Unix or Linux).
> >
> >
> > hth
> > christian
> >
> >   
> >> Hi
> >>
> >> Build a java class implements the interface i wrote and search through the opencms api for the right methods(there may will be an object to initiate and then add the paths to be exported, i think, or something like that). You have to search hard, but there defenitly will be something useful.
> >>
> >> I don't know exectly what methods and classes to use for the export, but i build an import system that waorks well with a class implementing the Schedular Interface using the importExportManager of opencms
> >>
> >>  
> >>
> >> 2006/10/6, maria.freixes_graells at alcatel.es <maria.freixes_graells at alcatel.es>:
> >> Hello Andy,
> >>
> >> Ok with your answer, but....I am doing backups with the Export Database
> >> option from "Database Import/Export Tools" from AdministrationView, and
> >>
> >> I can't see any option in the scheduler job classe any for this.
> >> Only there is one for CmsStaticExportJob, I think that is for doing an
> >> Static Export, isn't that?
> >> I've understand that Static Export is the copy of the OpenCms resources
> >>
> >> to the file system of the machine. But the Export Database it's an
> >> export of the files fro the OpenCms virtual file system to a zip file.
> >> This last option is the one that I'm searching, because afte that, I
> >> want to save the files into a tape.
> >>
> >> Any idea to do it?
> >>
> >> Anybody has implemented backup in their systems?
> >>
> >> Thanks and best regards,
> >> Maria
> >>
> >>
> >> Andy Bicksbo wrote:
> >>     
> >>> Hi
> >>> There is an admin tool called ScheduledJob in the OpenCms Adminview.
> >>>       
> >>> With this tool you can call every Java Classes which implements the
> >>> Interface I_CmsScheduledJob and set a cron expression for it.
> >>> I think there is already one for this export thing
> >>>
> >>> hth
> >>>       
> >>> Andy
> >>>
> >>>
> >>> 2006/10/4, maria.freixes_graells at alcatel.es
> >>> <mailto:maria.freixes_graells at alcatel.es
> >>>
> >>> <maria.freixes_graells at alcatel.es
> >>> <mailto:maria.freixes_graells at alcatel.es>>:
> >>>       
> >>>     Hello people,
> >>>
> >>>     I've read about doing backup of the OpenCms system through the export
> >>>     and import options from Administrator->Database Management. I've
> >>>     tried
> >>>       
> >>>     it and it will be usefully for me scheduling the task in the cron in
> >>>     order to execute them at night.
> >>>
> >>>     I'm searching for information or some solution implemented for the
> >>>     cron
> >>>       
> >>>     job doing the backup.
> >>>
> >>>     Could anyone help me with information or a solution for this, please?
> >>>
> >>>     Thanks and best regards,
> >>>
> >>>     Maria
> >>>
> >>>     _______________________________________________
> >>>       
> >>>     This mail is sent to you from the opencms-dev mailing list
> >>>     To change your list options, or to unsubscribe from the list,
> >>>     please visit
> >>>     
> >>>       
> >> http://lists.opencms.org/mailman/listinfo/opencms-dev
> >>     
> >>> ------------------------------------------------------------------------
> >>>
> >>>
> >>> _______________________________________________
> >>>       
> >>> This mail is sent to you from the opencms-dev mailing list
> >>> To change your list options, or to unsubscribe from the list, please visit
> >>>
> >>>       
> >> http://lists.opencms.org/mailman/listinfo/opencms-dev
> >>
> >> _______________________________________________
> >> This mail is sent to you from the opencms-dev mailing list
> >> To change your list options, or to unsubscribe from the list, please visit
> >>
> >> http://lists.opencms.org/mailman/listinfo/opencms-dev
> >>
> >>
> >> -----------------------------------------------------------------
> >> _______________________________________________
> >> This mail is sent to you from the opencms-dev mailing list
> >> To change your list options, or to unsubscribe from the list, please visit
> >> http://lists.opencms.org/mailman/listinfo/opencms-dev
> >>     
> >
> >
> > _____________________________________________________________________
> > Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
> > http://smartsurfer.web.de/?mc=100071&distributionid=000000000066
> >
> >
> > _______________________________________________
> > This mail is sent to you from the opencms-dev mailing list
> > To change your list options, or to unsubscribe from the list, please visit
> > http://lists.opencms.org/mailman/listinfo/opencms-dev
> >   
> 
> 
> <hr>
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev


_______________________________________________________________________
Viren-Scan für Ihren PC! Jetzt für jeden. Sofort, online und kostenlos.
Gleich testen! http://www.pc-sicherheit.web.de/freescan/?mc=022222




More information about the opencms-dev mailing list