Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Old Backup Files Not Deleting #6675

Open
dmccracken-livewire opened this issue Jan 8, 2025 · 15 comments
Open

Old Backup Files Not Deleting #6675

dmccracken-livewire opened this issue Jan 8, 2025 · 15 comments
Labels

Comments

@dmccracken-livewire
Copy link

I just noticed that backup files from the past few years still exist in the folder where the daily backups are being saved (c:\temp).
Permissions appear to be ok (Full Control), particularly given that the files are being written there.
I searched everywhere I could on-line but didn't see any open/closed cases.
Suggestions?

Here are the config settings for backup:
"autoBackup": {
"backupIntervalHours": 24,
"keepLastDaysBackup": 15,
"zippassword": "xxxx",
"backupPath": "c:\temp"
}

  • OS: Windows 2016 Data Center
  • Network: WAN
  • Version: 1.1.37
  • Node: 22.12.0
@si458
Copy link
Collaborator

si458 commented Jan 8, 2025

whats the output of backupconfig from inside the console tab of My Server?
also whats the output of running autobackup from inside the console tab too?
can u share a screenshot of what files are inside the folder c:\temp\?

@dmccracken-livewire
Copy link
Author

backupconfig
DB Name: meshcentral
DB Type: SQLite
BackupPath: c:\temp
BackupFile: meshcentral-autobackup-2025-01-08-16-06.zip
Backup Interval (Hours): 24
Keep Last Backups (Days): 15
ZIP Password: Set
Backup IgnoreFilesGlob:
Backup SkipFoldersGlob:

autobackup
Starting auto-backup...
Creating encrypted ZIP
Auto-backup completed.

I had manually deleted all files prior to 10/1/2024 so there currently are only 103 files in the directory. I've attached a screenshot with the most recent since they all won't fit in the screenshot.

tempfile

@si458
Copy link
Collaborator

si458 commented Jan 8, 2025

thats not right 😆 will look into it for you!
my test machine uses S3 for my backups and the maxfiles works
my production used a normal backup but uses nedb for its database and works correctly
so it might be a bug with sqlite, leave it with me! 👍

@dmccracken-livewire
Copy link
Author

BTW, we just migrated from nedb to sqlite today, so prior to today all the backups were using nedb
Thanks!

@si458
Copy link
Collaborator

si458 commented Jan 8, 2025

@dmccracken-livewire erm? im not sure then? as its working perfectly fine here?
i notice a sudden SIZE increase in the zip between 7th 9am and 7th 3pm,
did you do an upgrade at all then?
if i remember the was a bug with the old backups and keeping them,
so maybe wait and see what happens after 15 days?

@dmccracken-livewire
Copy link
Author

yes we just upgraded from 1.1.19 to 1.1.37 yesterday (Issue ## #6671)

@si458
Copy link
Collaborator

si458 commented Jan 8, 2025

@dmccracken-livewire oh right yes sorry i remember!
i would say try turning the backups down to say 2 days, and restart meshcentral
then see what happens in 2 days, in theory it should then only keep 2 zip files
if you was runing 1.1.19 originally then indeed thats quite an old version and the bug might of existed then!

@dmccracken-livewire
Copy link
Author

I was thinking the same thing. I'll give it a shot and let you know early next week.

@PathfinderNetworks
Copy link

I just took a look at my two MeshCentral servers and am seeing this same thing. I have KeepLastDaysBackup set to 15 but am seeing backup zip files from months ago. I'm running under Windows Server 2022 and another on Server 2025. Both using MongoDB. I always stay on the current version (usually update within a day or two of version release) so no idea when this would have started. I know it's been like this for a long time as I go in and manually delete old backup files whenever I am doing server maintenance. Definitely been like this for at least the last 6 months- almost certainly longer than that.

@si458
Copy link
Collaborator

si458 commented Jan 8, 2025

@PathfinderNetworks yes i believe the might of been a long standing bug with the local backups for quite a while!
it should of been fixed in 1.1.34 (avoid used 1.1.35 instead) which wasnt released until beginning of december
so maybe try the latest version and see if its fixed?

@PathfinderNetworks
Copy link

I'm on 1.1.37 and installed that the same day Ylian made it available. Still seeing this behavior- now, granted, it's not been 15 days. That being said, I had upgraded to both 1.1.34 and 1.1.35 the same day those were released as well. I think that's been more than 15 days?

@si458
Copy link
Collaborator

si458 commented Jan 8, 2025

im wondering if its a windows bug maybe?
im using linux and nedb and local backups and it seems to be working here (my production server too)
just changed my keepLastDaysBackup to 2 and then restarted and ran autobackup and checked my backup folder

simon@meshcentral:~/meshcentral/meshcentral-backups$ ls -la
total 130772
drwxr-xr-x 2 simon simon     4096 Jan  8 21:21 .
drwxrwxr-x 6 simon simon     4096 Nov  4 13:26 ..
-rw-r--r-- 1 simon simon 22429707 Jan  4 09:58 meshcentral-autobackup-2025-01-04-09-57.zip
-rw-r--r-- 1 simon simon 22319127 Jan  5 09:58 meshcentral-autobackup-2025-01-05-09-57.zip
-rw-r--r-- 1 simon simon 22482099 Jan  6 09:59 meshcentral-autobackup-2025-01-06-09-59.zip
-rw-r--r-- 1 simon simon 22159369 Jan  7 09:59 meshcentral-autobackup-2025-01-07-09-59.zip
-rw-r--r-- 1 simon simon 22190421 Jan  8 09:59 meshcentral-autobackup-2025-01-08-09-59.zip
-rw-r--r-- 1 simon simon 22304463 Jan  8 21:21 meshcentral-autobackup-2025-01-08-21-21.zip
simon@meshcentral:~/meshcentral/meshcentral-backups$ ls -la          <- AFTER autobackup was run
total 86864
drwxr-xr-x 2 simon simon     4096 Jan  8 23:52 .
drwxrwxr-x 6 simon simon     4096 Nov  4 13:26 ..
-rw-r--r-- 1 simon simon 22159369 Jan  7 09:59 meshcentral-autobackup-2025-01-07-09-59.zip
-rw-r--r-- 1 simon simon 22190421 Jan  8 09:59 meshcentral-autobackup-2025-01-08-09-59.zip
-rw-r--r-- 1 simon simon 22304463 Jan  8 21:21 meshcentral-autobackup-2025-01-08-21-21.zip
-rw-r--r-- 1 simon simon 22276554 Jan  8 23:52 meshcentral-autobackup-2025-01-08-23-52.zip



> backupconfig
DB Name: meshcentral
DB Type: NeDB
BackupPath: /home/simon/meshcentral/meshcentral-backups
BackupFile: meshcentral-autobackup-2025-01-08-23-54.zip   <- THIS FILENAME IS THE NEXT FILENAME IF RAN NOW
Backup Interval (Hours): 24
Keep Last Backups (Days): 2
Backup IgnoreFilesGlob: 
Backup SkipFoldersGlob: 

@dmccracken-livewire
Copy link
Author

Is there any type of logging that i might be able to enable to help find where the issue is?
I looked through the Event logs but nothing jumped out there.

@si458
Copy link
Collaborator

si458 commented Jan 9, 2025

the is no logs, the only log u have is running autobackup and it will tell you if the backup was successful or not,
then check your backups folder and see what it did (make copied first if the backups are important!)

we should really add some sort of logs in somewhere maybe
(anyone wanna create feature request with suggestions how we log and where?)

also it doesnt tell you IF it cleaned up files for local backups which ive only just spotted!
however it does tell u if its deleting files IF u use WEBDAV or S3

@PTR-inc
Copy link
Contributor

PTR-inc commented Jan 9, 2025

I can look into this, already saw a bug with custom names and can add some info output. Same as webdav, files seen/deleted/error.
Webdav uses the lastmod file atrribute btw instead of the date in the filename to select for deletion, which could also be a point of discussion as the filename stays the same, file attribs are mutable by external (system) factors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants