Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
SOLVED

MongoDB Backup - Further helps needed

RE5260
8 - Asteroid

Hi Team,

 

I created a.bat file that is scheduled to run every day at 12:10 GMT in order to create the Alteryx Server MongoDB Backup. This file creates a folder that has the current date stamped in it. (i.e. MongoDB_Backup_06_02_2024)

 

Every time the folder is created, 1.4 GB of data is loaded to it. And sometimes we notice that the folder is just 1 KB, which indicates that the backup did not go through that day properly. Viewing the properties of the folder by logging in to the server is a manual task.

 

Q. 1. Is there a way to set up email notifications for myself? For example, if the produced backup folder is smaller than 100 MB, the status is: Needs checking; if larger, we'll assume it's alright.

 

Q. 2. The backup folders are stored locally on the server. We are going to keep data for the last 7 days, and any subfolders in the designated folder that are more than seven days old those will be manually removed. Is it possible to automate this so that we don't need to delete the folders manually? For example, by developing a workflow that will do the deletion task, or by using an alternative procedure or scripts.

 

Please assist.

4 REPLIES 4
fmvizcaino
17 - Castor
17 - Castor

Hi @RE5260 ,

 

Q1. You can have another bat script to measure the size of the mongoDB folder: https://www.hivelocity.net/kb/how-can-i-tell-the-total-amount-of-space-used-by-a-folder-including-su...

 

Q2. For file deletion, I have two suggestions.

 

Best,

Fernando Vizcaino

 

Q2. 

RE5260
8 - Asteroid

Hi fmvizcaino

 
 
 

Q1. All of the folders, together with their subfolders and file sizes, are displayed. However, we needed to present a report that included all of the folder sizes that are created every day. We would like to automate the process of manually logging into the servers and verifying their sizes. Please assist if you can. 

 

Q2. It's used to remove files. I thus Googled and constructed a batch script that removes directories that are more than seven days old.

 

cd /d D:
forfiles /S /P "D:\MongoDB_Backup" /D -30 /C "cmd /C IF @isdir == TRUE rd /S /Q @path"

 

Peachyco
11 - Bolide

You say that you can already see the folders and their respective sizes.

 

Then run them through a Filter Tool to get only the suspicious folders (e.g. [Folder Size] < 100 MB), pass those folder names to a Report Text Tool, and finally, send the notification to your intended recipients using the Email Tool.

 

If there are no suspicious folders, nothing will get past that Filter Tool, and there will ultimately be no email sent to you. So, this will be an automated mechanism for notifying you only when an issue arises.

RE5260
8 - Asteroid

It's done