Showing posts with label Windows. Show all posts
Showing posts with label Windows. Show all posts

Tuesday, January 7, 2014

Automated backup of mySql database

To make back up mysql database automatically,we may use task scheduler(for windows) or cron for linux server.

at winodws, we can execute a batch file using task scheduler. The content for batch file is:
--
@echo off
echo Running Rsa dump...
-h -u -p --result-file=
echo Done!

--


for my case the batch file was:
--
@echo off
echo Running Rsa dump...
G:\BACK_UP_Database\mysqldump\newer\mysqldump -h 10.76.12.51 -uroot -p*paul*db# --result-file="G:\BACK_UP_Database\RSA\backup_%DATE%.sql" rsadb
echo Done!
--

it should be noticeable that the user and password is stick to the -u and -p parameter. If we provide space among them then password will be prompt for to input.

The short date format should not contain slash. It causes problem to create file with that name. we may set the short date format as yyyy-MMM-dd .

After that we will have to configure the task manager according to our requirements.

Wednesday, February 22, 2012

Executing a JAR file using Windows Task Scheduler

Generally, when we click over a jar file , it executes. But if we are in need of executing a jar file using Windows Scheduler it invites some barriers(!).
We are not in need to do something incredible, just usingthe Windows Task Scheduler. . We need to customize the various prefrences for setting up the task in the windows scheduler.

Since a JAR file is not a Windows executable file, all you need to do is:

1. Type task in the run from the start menu(for windows 7).
2. from the action panel of the right side of the window, select Create task.
3. Filling all the parameters of General and Trigger panel, from the action panel
Set program or script to the location of java.exe from the specified location of the jre folder.
C:\Program Files\Java\jre6\bin\java.exe
Set add arguments option to something like the command line to execute the jar.
-jar D:\jarFileLocation\jarFile.jar