1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Improved Google Drive autobackup.

This commit is contained in:
Ylian Saint-Hilaire 2020-08-21 11:47:34 -07:00
parent edd018e35a
commit bf87bbd4a3
21 changed files with 973 additions and 769 deletions

View file

@ -1397,13 +1397,13 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
// Indicates if the agent has a coredump available
if ((command.exists === true) && (typeof command.agenthashhex == 'string') && (command.agenthashhex.length == 96)) {
// Check if we already have this exact dump file
const coreDumpFile = parent.path.join(parent.parent.datapath, 'coredumps', obj.agentInfo.agentId + '-' + command.agenthashhex + '-' + obj.nodeid + '.dmp');
const coreDumpFile = parent.path.join(parent.parent.datapath, '..', 'meshcentral-coredumps', obj.agentInfo.agentId + '-' + command.agenthashhex + '-' + obj.nodeid + '.dmp');
parent.fs.stat(coreDumpFile, function (err, stats) {
if (stats != null) return;
obj.coreDumpPresent = true;
// Check how many files are in the coredumps folder
const coreDumpPath = parent.path.join(parent.parent.datapath, 'coredumps');
const coreDumpPath = parent.path.join(parent.parent.datapath, '..', 'meshcentral-coredumps');
parent.fs.readdir(coreDumpPath, function (err, files) {
if ((files != null) && (files.length >= 20)) return; // Don't get more than 20 core dump files.