datenbank per cronjob sichern?

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
christoph
Posts: 1
Joined: Fri Jul 18, 2003 8:28 pm
Contact:

datenbank per cronjob sichern?

Post by christoph »

hiho,

ich frage mich gerade, ob es eine einfache möglichkeit gibt, die datenbank per cronjob zu sichern?

auf rechner a) läuft phpMyFaq , dort hab ich nur ftp-zugriff
auch rechner b) kann ich cronjobs laufen lassen.

von b) aus würde ich gerne die sicherung anstoßen... hat da jemand eine idee, wie das möglichst unaufwändig geht?

gruß,
christoph
Thorsten
Posts: 15792
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

mit einem PHP-Skript, dass das Backup macht, geht das sicherlich. Das Php-Skript muss von Rechner B halt aufgerufen werden, zB mit wget oder lynx.

Hier findest du ein kleines Script zum Sichern: http://faq.puretec.de/skripte/mysql/2.html

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Outlaw
Posts: 104
Joined: Sun Oct 26, 2003 5:07 pm

Post by Outlaw »

Bei Shellzugang am besten per Skript die mysql dump Funktion benutzen.

Mal hier schauen:

http://www.rootforum.de/forum/viewtopic ... mysql+dump

Gruß Outi
jazcyk
Posts: 385
Joined: Wed Sep 07, 2005 1:32 pm

SJA/SQLyog

Post by jazcyk »

SJA für Linux is frei. www.webyog.com.

Ich bin im prozes eine neue Dokumentation zu schreiben.
Erste Versuch (English):

*******************************************************

Introduction

SQLyog Job Agent (SJA) v5.02 is a high-performance, multithreaded, multi-platform application that lets you run maintenance scripts with your MySQL databases, have e-mailed formatted resultsets of a query, import data and metadata from ODBC-sources, synchronize MySQL databases and tables and do high-performance scheduled backups. On Windows, it is included with SQLyog Enterprise 5.02 - the latest version of the award winning MySQL Client. SJA for Linux is free for commercial and personal use and can be downloaded here.

SJA is a command line tool that accepts a Job Definition file encoded in XML as one of the parameters. You can either create the Job Definition file manually or use one of the wizards included with SQLyog Enterprise. If you use SQLyog Enterprise to create your job files, you don’t need to have any knowledge about XML or the Job Definition schema. The Windows version also can be run from inside the SQLyog GUI, making its command line nature transparent to users if you want so.

On Windows platforms, SQLyog uses the Task Scheduler services to schedule your jobs. On Linux, you can use cron to schedule jobs. SJA can also be invoked by an application, no matter if it is a web page script (PHP, JSP, ASP) or a compiled binary.

SJA does not require any installation at hosts running the MySQL server. You can use any host to run the SJA. Technically SJA is a MySQL client that connects to any MySQL server in the world that allows for connections from a remote client. The client code that is used is the standard MySQL C-API compiled into the SJA executable. The Windows version of SJA further has the same advanced connectivity options as SQLyog Enterprise: HTTP(S)-tunnelling, SSH-tunnelling and proxy authentication.

There are four job types available with the SJA:
1) Notifications Services
2) SQLyog Migration Tool (NOTE: this one is NOT available with the Linux SJA version)
3) MySQL data synchronization
4) SQLyog Backup Tool. Mostly used for ‘Scheduled Backup’

You can start SJA from SQLyog Enterprise ‘Powertools’ menu or from command line. Command line syntax is

sja jobfile.xml -llog.txt -ssession.xml

The -s and -l parameters for specifying the session file and the log file are optional. A complete file path can be specified. That is useful if you don’t have write privilege to the installation folder. If not specified default values logfile.txt and session.xml are used and file are placed in the directory from where SJA runs. The jobfile will often be a file with an .xml extension (and the full file name must be written), but need not use that extension. Extension can be anything. Thus you may use the extension .sja for instance and associate the .sja extension with the SJA executable in the OS. Then you can execute all .sja –files with a single mouse-click.

To execute more SJA jobfiles and to execute SJA with other executables and system commands you can use the batch-processing facility of the OS (a .bat –file on Windows) or a script/an application.


What to use it for

1) Notifications service.
Lets you run ANY SQL script against a MySQL database and lets you have the result of ANY SELECT-query delivered to your mailbox as formatted HTML. To be used for all sorts of database maintenance, and any sorts of verification of data.

2 Migration Tool
Import Data and Metadata (all sorts or indexes – also Foreign Keys/relationships) from any ODBC-compliant data source. There are a broad variety of options available for mapping and filtering the imported data. Also the SQLyog Migration Tool includes a trigger-functionality to ‘write-back’- changes to the database imported from. Used in conjunction with the filtering options it can be used for incremental import. The SQLyog Migration Tool is the most flexible and versatile tool if you want to migrate your databases to MySQL or if need to have more database systems within an organisation. There is more to read about the Migration Tool here: http://www.databasejournal.com/features ... 97_3550146

3) MySQL data synchronization.

To be used to synchronize data whenever you have two MySQL databases or database tables of identical structure. For example you can use SJA to keep your production databases (probably hosted with an ISP) in complete sync with your test database located in your PC or LAN.

You can configure SQLyog/SJA for One Way or Two Way synchronization. In one way synchronization, no modification is done in the source database. Two way synchronization allows you to transfer data from the source to the target and vice-versa. Additionally, you can configure SJA to detect changes only for specific rows and columns. For example you can exclude blob columns or include only those rows that fulfill a WHERE clause. This makes it an ideal tool to sync data even if there is limited bandwidth or limited server resources. SJA uses an efficient algorithm to generate checksums to find out the changes. Therefore, only those rows that have been inserted, updated or deleted since the last sync are transferred between the hosts. There is more to read about the Data Synchronization Tool here: http://www.webyog.com/articles/Using_SQ ... abases.pdf


4) SQLyog backup Tool

This tool is mostly used as a tool for Scheduled Backup. However you may of course too define a job and run it immediately. This backup tool has many options for selection of what should be backed up and how it shall be saved. It backs up all available information (if you choose) from the databases or tables selected: data, all sorts of indexes, MySQL ver 5 Objects, partition structure of partitioned tables (as of MySQL 5.1). http://www.webyog.com/articles/how_to_u ... ackup.html



The SJA XML Schema

The SJA job file is a pure text file in a standard XML format. It specifies what the SJA must do. Everything is included between the <job> and </job> tags, that starts and concludes a SJA jobfile. Each of the four above-mentioned job types are identified by the tags <notifyjob>, <odbcimport>, <syncjob> and <exportjob> .


Mehr Info:
http://webyog.com/faq/category24.html
http://webyog.com/faq/category17.html
Post Reply