View Single Post
Old 15th June 2012, 10:08
till till is offline
Super Moderator
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 34,586
Thanks: 792
Thanked 4,983 Times in 3,903 Posts

It would be great of course if you could implement it in ispconfig directly

Such a script requires actions as root user, so it has to be be splitted into a interface part where you can define the settings like remote server IP, root password and database login. The interface part then writes the config data as an action to the sys_remoteaction and a server side plugin must be registered for the action event and start the migration. So there is no need for a additional database table for such a job. The new action framework has been added in SVN and will be part of 3.0.5.

A SQL query to insert a action might look like this:

$sql = 	"INSERT INTO sys_remoteaction (server_id, tstamp, action_type, action_param, action_state, response) " .
								"VALUES (".
								(int)$this->form->dataRecord['server_id'] . ", " .
								time() . ", " .
								"'backup_restore', " .
								"'".$backup_id."', " .
								"'pending', " .
								"''" .
Instead of the $backup_id you can also add several parameters as serialized array.

For the server side plugin, see new backup plugin as example for using the actions framework:

Till Brehm
Get ISPConfig support and the ISPConfig 3 manual from
Reply With Quote