Win a flower (🌹) or copy of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java (📚) this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Bear Bibeault
  • Liutauras Vilda
  • Devaka Cooray
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Automat backup

 
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends Im here with a big headache,

Im developing a web base app in windows xp environment. Im using servlets and jsp. Im using tomcat as the web container and mysql as the backend. I need to automate the backup process (ie) a process should trigger automatically from the server and take all the backups daily or whatever.

Can anydoby help me to find a solution for this? plzzzzzzzzzzzzzzzzzzz
 
pioneer
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
a process should trigger automatically from the server and take all the backups daily or whatever.

Are you referring to backups of your database? Please clarify.
 
Marshal
Posts: 67357
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Servlets and JSP are not an appropriate technology choice for this.

Rather, you should use whatever facilities your native OS uses to schedule background operations. For example cron on Linux and OS X. Windows has some sort of scheduler thingy but I'm not sure of the details.
 
Jenn Person
pioneer
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Bear, if you want to backup your database, then Servlets and JSP is a poor choice. You'll have to create something in DOS since you're using Windows to run a MySQL dump on the interval you want.
[ May 15, 2007: Message edited by: Jenn Person ]
 
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you need job scheduling mechanism, try Quartz


Sample uses of job scheduling with Quartz:

  • Driving Workflow: As a new order is initially placed, schedule a Job to fire in exactly 2 hours, that will check the status of that order, and trigger a warning notification if an order confirmation message has not yet been received for the order, as well as changing the order's status to 'awaiting intervention'.
  • System Maintenance: Schedule a job to dump the contents of a database into an XML file every business day (all weekdays except holidays) at 11:30 PM.

  •  
    pioneer
    Posts: 2308
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator

    Originally posted by Hussam Bamatraf:
    If you need job scheduling mechanism, try Quartz



    Quartz is a very sophisticated tool for this purpose.If is a simple backup program then you even might consider java's Timer and TimerTask classes.
     
    steward
    Posts: 6663
    5
    MyEclipse IDE Firefox Browser Linux
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Where do you need to backup the DB ? As others have mentioned, servlets and JSPs wont do good here. They are not meant to do database backups. What you need is a scheduler or a DB specific tool that does auto back ups.
     
    pioneer
    Posts: 160
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    As mentioned before, the backup process should be handled outside of your web container.

    mysqldump is the appropriate tool. Window has a scheduling facility, "Scheduled Tasks", and even a Cron service with Windows SFU. You can also schedule backups from within MySQL (MySQL Admin->backup->new project->schedule).

    In addition, I would suggest using a separate machine for backups. This machine should be well suited for the task, providing redundant disk storage of your data. It is not a bad idea to keep an archive of the backups either.

    I use MySQL on Linux. Without giving to much away about our configuration, here is some information about our backups.

    The backup user (username something other than backup), has a limited shell.
    The backup user only has read access and can only connect from a particular IP/hostname.
    no user besides root and the backup user can view the backup home dir, script, or resulting dump files.
    The dump files are compressed and encrypted
     
    Villains always have antidotes. They're funny that way. Here's an antidote disguised as a tiny ad:
    Java file APIs (DOC, XLS, PDF, and many more)
    https://products.aspose.com/total/java
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!