34 views
Wat is de beste manier om je data uit MySQL te backuppen? zet hiet jouw manier neer!
2. User Level Backups
CMD_API_SITE_BACKUP
method can be GET or POST.
###################
#list current available backup files
domain=domain.com (hidden value, doesn't affect the outcome of the backup, but is required)
###################
#create a backup
action=backup
domain=domain.com (hidden value, doesn't affect the outcome of the backup, but is required)
for the following items, include whichever ones you wish to include in the backup. The format is select0=<b>item</b>, where you would use select1=<b>item2</b> for the next item, etc.
domain
subdomain
forwarder
autoresponder
vacation
list
emailsettings
ftp
ftpsettings
database
See the Actual user backup page to see what each item does.
###################
#restore a backup
action=restore
domain=domain.com (hidden value, doesn't affect the outcome of the backup, but is required)
file=filename.tar.gz
Include the desired items using the same select0=item technique as above. Use the action=view command from below to see what items are actually available to restore.
###################
#view a backup file's contained items.
action=view
domain=domain.com (hidden value, doesn't affect the outcome of the backup, but is required)
file=filename.tar.gz
returns a list of selectable items (see the above list )
<?php
include('da_api.php');
//het is een class dus we defineren het ook als een class
$sock = new HTTPSocket;
//maak verbinding met de server
$sock->connect('domain.com',2222);
//we moeten ook vertellen wie we zijn en dat we willen inloggen.
$sock->set_login('username','password'); // Van DirectAdmin
$sock->query('/CMD_API_SITE_BACKUP','domain=domain.com&action=backup&select10=database');
?>