Permalink
Browse files

v3.0.4 - Fix bugs with backupCore.

-v3.0.4.
-Fix bugs with backupCore on and around lines 61, 81, and 88.
-Revise some of the checks.
-Hide the Backup Now button in settings page when $BackupsEnabled is set to anything but '1'.
-Commit the first version of cron shell script for testing.
  • Loading branch information...
zelon88 committed Jan 6, 2019
1 parent bc1d291 commit ea81a7971dfd156d3986fe7178fc74799f3183f9
Showing with 25 additions and 13 deletions.
  1. +12 −2 CHANGELOG.txt
  2. +1 −1 HRCloud2_Backup_Cron.sh
  3. +6 −7 backupCore.php
  4. +2 −2 compatibilityCore.php
  5. +3 −0 settingsCore.php
  6. +1 −1 versionInfo.php
@@ -1,5 +1,15 @@
COMMIT 1/3/2019
v3.0.3 - Add backupCore, enable on-demand user data backups.
COMMIT 1/5/2019
v3.0.4 - Fix bugs with backupCore.

-v3.0.4.
-Fix bugs with backupCore on and around lines 61, 81, and 88.
-Revise some of the checks.
-Hide the Backup Now button in settings page when $BackupsEnabled is set to anything but '1'.
-Commit the first version of cron shell script for testing.

----------
COMMIT 1/4/2019
v3.0.3 - Add backupCore, enable on-demand backups.

-v3.0.3.
-Fix typo in commonCore.php
@@ -1 +1 @@
#!/usr/bin/php -f /var/www/html/HRProprietary/HRCloud2/backupCore.php execute
#!/usr/bin/php /var/www/html/HRProprietary/HRCloud2/backupCore.php execute
@@ -2,7 +2,6 @@
// / This file represents the HRCloud2 Backup Core. It is responsible for backing up all Cloud User Data to whatever location is specified in the config.php file.
// / If no $BackupLocation is set in config.php this file will produce a backupWarning.log file in the root HRCloud2 directory which triggers the HRCloud2 Settings Core to display a warning to the administrator.
// / It can safely be run from a local terminal or cron at any time, however large Cloud instances can take A LONG TIME to sync.
// / Therefore, this file WILL NOT start a new instance while a sync is in process.
// / -----------------------------------------------------------------------------------
// / The following code sets variables for the session.
@@ -64,7 +63,7 @@
$BackupCreatedFolders++;
continue; } }
// / The following code checks if the selected item is a file, and creates a backup copy if it is.
else if (!is_link($item) && !file_exists($BUL)) {
else if (file_exists($item) && !is_link($item) && !file_exists($BUL) && !is_link($BUL)) {
copy($item, $BUL);
$BackupCreatedFiles++; } }
// / The following loop makes sure that the backup contains only the latest copy of files, and only files that still exist in the CloudLoc.
@@ -73,19 +72,19 @@
\RecursiveIteratorIterator::SELF_FIRST) as $item) {
$CUL = $CloudLoc.DIRECTORY_SEPARATOR.$iterator->getSubPathName();
$BackupScannedFilesBackup++;
// / The following code checks if the selected item is a folder.
if (!file_exists($CUL) && !is_dir($item)) {
// / The following code checks if the selected item is a folder and if a matching Cloud folder is missing.
if (!file_exists($CUL) && is_dir($item)) {
$CULFiles = @scandir($item);
// / The following code checks if the folder is empty, and deletes it if so.
if (count($CULFiles) <= 2) {
if (count($CULFiles) == 2) {
rmdir($item);
$BackupRemovedFolders++; }
// / The following code checks if the original user file was deleted and deletes the backup if needed.
if (!file_exists($CUL) && is_dir($item) && count(scandir($item)) == 2) {
if (!file_exists($CUL) && file_exists($item) && !is_dir($item)) {
unlink($item);
$BackupRemovedFiles++; }
// / The following code checks if the Cloud file is newer than the Backup file, and replaces the backup if so.
if (!is_link($CUL) && filemtime($CUL) > filemtime($item)) {
if (!is_link($CUL) && @filemtime($CUL) > @filemtime($item)) {
unlink($item);
copy($CUL, $item);
$BackupReplacedFiles++; } } } }
@@ -2,8 +2,8 @@
/*
HRCLOUD2 VERSION INFORMATION
THIS VERSION : v3.0.3
WRITTEN ON : 1/4/2019
THIS VERSION : v3.0.4
WRITTEN ON : 1/5/2019
*/
// / -----------------------------------------------------------------------------------
@@ -634,9 +634,12 @@ function selectChanged(id1, id2) {
<input type='submit' name='CheckCompatibility' id='CheckCompatibility' value='Compat Check' style="padding: 2px; border: 1px solid black" onclick="toggle_visibility('loading');"/>
</p>

<?php
if ($EnableBackups == '1') { ?>
<p alt="Backup all user submitted data." title="Backup all user submitted data." style="padding-left:15px;"> Backup User Data: </p>
<p style="float:center; padding-left:10%;"><input type='submit' name='backupUserDataNow' id='backupUserDataNow' value='Backup Now' style="padding-left:30px; padding: 2px; border: 1px solid black" onclick="toggle_visibility('loading');"/></p>
<input type='hidden' id='backupNowToken' name='backupNowToken' value='<?php echo $BackupToken; ?>'/>
<?php } ?>

<p alt="Verify the permissions level, owner, and group of HRCloud2 controlled directories." title="Verify the permissions level, owner, and group of HRCloud2 controlled directories." style="padding-left:15px;"> Permissions Check:</p>
<p style="float:center; padding-left:10%;">
@@ -1,4 +1,4 @@
<?php
// / This file contains the current HRCloud2 version for auto-update purposes.
// /
$Version = 'v3.0.3';
$Version = 'v3.0.4';

0 comments on commit ea81a79

Please sign in to comment.