diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index e1043f405..813eb722f 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -6,6 +6,7 @@ import itertools import json import logging import os +import pathlib import sys import tarfile import traceback @@ -1166,6 +1167,12 @@ class Core(commands.Cog, CoreLogic): @checks.is_owner() async def backup(self, ctx: commands.Context, *, backup_path: str = None): """Creates a backup of all data for the instance.""" + if backup_path: + path = pathlib.Path(backup_path) + if not (path.exists() and path.is_dir()): + return await ctx.send( + _("That path doesn't seem to exist. Please provide a valid path.") + ) from redbot.core.data_manager import basic_config, instance_name from redbot.core.drivers.red_json import JSON