The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Backup userspice files & table
#21
Furthermore to this, how about if backup all is the selected type (similar to how single table you select the table), we can check all checkboxes, but not list the backup folder, and then we define the backupItems instead of the system deciding? Think it might fix it?
  Reply
#22
Don't know if this is a solution or not...but moving the backup folder outside of my root directory fixed my issues and no longer backs up the backup folder...so my destination is ../backups/
  Reply
#23
@Firestorm...yeah... I get that...my problem is that I build most of my apps in at mydomain.com with login being at mydomain.com/users/login.php

The good thing, like I said, is that I can get by with basically backing up /uploads and my db. I don't even really need to back everything up through the built in backup system. On the other hand, with index.php being in root, I wouldn't be surprised if the bulk of people don't put their application there. The thought was that they would have a clean root directory with userspice out of the way.
  Reply
#24
@Brandin - The only issue with that would be server permission issues. You would have to put the backup folder BELOW root to hide it using that method. We can't assume that we'll have that permission on the server. We already know we have write permission in the root folder or we wouldn't have been able to make the init.php file during the install process.
  Reply
#25
True...well that is my temporary solution! I will see what I can crack while I code on my next few days off and if I come up with something I'll let y'all know!
  Reply
#26
Sounds good @Brandin.

  Reply
#27
@Firestorm...prayers are with your family. Thanks for all you're doing.
  Reply
#28
Thanks @mudmin means a lot,

i think I've solved the backup saving back issue, in admin_backup.php around line 78 replace:

Code:
$backup_dest = .$settings->backup_dest;

with:

Code:
$backup_dest = ".".$settings->backup_dest;

what I've done is prepend a DOT to the directory name so that recurse_copy() thinks its a file so then recurse_copy will basically not recognise its file type and ignore it,


we now need to apply the fix to the
Code:
$allBackupFiles
variable around line 362 so we have the right path to display the back ups.

I've only tested on localhost on mac which works as it should and doesn't hide the directory and i believe windows wouldn't either.

EDIT: scrap that lol, only worked because MacOS had hidden file, back to drawing board

I'm looking at shortening the filename as @Brandin reported so i may strip sha1 and replace with something more adaptable, i would use random_str() but its only php7 > and a polyfill has to be used for php5 > which seems a bit over the top for filenaming, maybe just strip sha1 leaving timestamp. i can't see many people wanting more than a few backups but i could be wrong
  Reply
#29
haha. You got me excited with that fix.

I was expecting to see an array of actual files being built somewhere in there, but I couldn't find one. My initial thought was to make the temp directory and the zip file begin with USBackup or something like that and then just tell the app to ignore anything that began with usbackup.
  Reply
#30
ha ha shame its not april lol

well looks like I've fixed it, on localhost at least, haven't tested remote.ive prefixed the backup directory name with @ and then in backup_util.php extended the RecursiveFilterIterator class with a filter excluding @.

I've updated the gist with your inclusion of everywhere and my fix, you'll only need to replace admin_backup.php and backup_utils.php

backup the old one first, just in case.

oh make sure to add @ to the backup folder if you have an existing one i.e: @backups/

fingers crossed

https://gist.github.com/Firestorm-Graphi...48cb0e01d8
  Reply


Forum Jump:


Users browsing this thread: 14 Guest(s)