Skip to content

Commit

Permalink
Cron fix #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Commifreak committed Apr 24, 2023
1 parent dab8c4a commit 6d6b9fe
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
1 change: 0 additions & 1 deletion src/include/ABSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ public function checkCron() {
ABSettings::$appName .= '.beta';
ABSettings::$pluginDir .= '.beta';
ABSettings::$tempFolder .= '.beta';
ABSettings::$cronFile .= '_beta';
ABSettings::$supportUrl = 'https://forums.unraid.net/topic/136995-pluginbeta-appdatabackup/';
}
ABSettings::$externalCmdPidCapture = '& echo $! > ' . escapeshellarg(ABSettings::$tempFolder . '/' . ABSettings::$stateExtCmd) . ' && wait $!';
18 changes: 1 addition & 17 deletions src/scripts/checkCron.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,7 @@

require_once(dirname(__DIR__) . '/include/ABSettings.php');

echo "Checking cron." . PHP_EOL;

/**
* Old cron style remnants - ged rid of it
*/
if (file_exists('/etc/cron.d/appdata_backup')) {
@unlink('/etc/cron.d/appdata_backup');
}
if (file_exists('/etc/cron.d/appdata_backup_beta')) {
@unlink('/etc/cron.d/appdata_backup_beta');
}

if (($argv[1] ?? null) == '--remove') {
@unlink(ABSettings::$pluginDir . '/' . ABSettings::$cronFile);
echo "cronfile deleted!" . PHP_EOL;
exit;
}
echo "Manually checking cron." . PHP_EOL;

$abSettings = new ABSettings();
$abSettings->checkCron();
Expand Down

0 comments on commit 6d6b9fe

Please sign in to comment.