Ausführung von exec in cronjobs

Hallo,

ich möchte im cronjob via exec ein tar ausführen. Wenn ich den cronjob in der console, also php bin/console sw:cron:run Shopware_CronJob_IbrZipShopBackup, aufrufe, dann wird das tar Kommando korrekt ausgeführt.

Wird der cronjob aber über http://www.meinshop.de/backend/cron gestartet, so klappt zwar der Start des cronjobs, aber das tar wird nicht ausgeführt. Das der Aufruf funktioniert, sehe ich daran, dass die Verzeichnisse entsprechend angelegt werden.

Um das exec zu umgehen, hatte ich auch schon probiert mit dem PharData-Object zu arbeiten. Da bekomme ich aber folgende Fehlermeldung im php-Log:

_Uncaught Error: Class 'IbrZipShopBackup\Subscriber\PharData' not found in ..._

Muss ich das über ein Use … einbinden? Wie würde das konkret aussehen?

 'onCronjobExecute'
        );
    }

    /**
     * listener-method for cronjob-subscriber
     *
     * @param Shopware_Components_Cron_CronJob $job
     */
    public function onCronjobExecute(\Shopware_Components_Cron_CronJob $job)
    {

        $directoryPath = "_backup"; 
        if (!file_exists($directoryPath)) {
            mkdir($directoryPath);
        }

        $directoryPath = "_backup/" . date('Ymd');
        if (!file_exists($directoryPath)) {
            mkdir($directoryPath);
        }

        $directoryPath = "_backup/" . date('Ymd');
        if (file_exists($directoryPath)) {
            
            $tar_file = "_backup/" . date('Ymd') . "/shop_" . date('Ymd_Hi') . ".tar.gz";

            $command = "tar cfvz " . $tar_file . " --exclude='_backup' " . getcwd();
            exec($command);

        }

    }
}