CCU1: Systembackup erstellen

Hallo,

ich würde gern regelmäßig ein Systembackup erstellen wollen. Dazu muss auf der CCU dieser Link (http://<homematic-ip>/config/cp_security.cgi?sid=<SID>&action=create_backup) aufgerufen werden. Wie stelle ich das aus IPS heraus an?
Teilerfolge habe ich schon mit der SID. Dann wollte ich mir den History Buffer, der als csv vorliegt, abholen. Das klappt allerdings nicht:

<?

 //URL=http://homematic/config/cp_security.cgi?sid=@FUtqqiCMh7@&action=create_backup
//URL=http://homematic/HistoryBuffer.csv?sid=@MlETd1qeo0@


$hmgui = "http://homematic";
$ch = curl_init('http://homematic');
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);

$login = curl_exec($ch);
echo $login;

$sid = "@".GetTextBetween($login, "\@", "\@")[0]."@";
echo($sid);

//Liste abholen
$postdata = http_build_query(array('getpage' => '/HistoryBuffer.csv', 'sid' => $sid));

$opts = array('http' =>
                            array(
                                'method'  => 'POST',
                             'header'=> 'Content-Length: '.strlen($postdata)."
".
                                           'Content-Type: application/x-www-form-urlencoded',
                                'content' => $postdata
        )
);

$context  = stream_context_create($opts);
$anrufliste = file_get_contents($hmgui, false, $context);
echo ($anrufliste);





// -----------------------------------------------------------------------------
// Funktion(en)

function GetTextBetween($string, $start, $end)
	{
   preg_match_all( "/$start(.*)$end/U", $string, $match );
   return $match[1];
	}


?>