diff --git a/openwrt_backup/config.py b/openwrt_backup/config.py index b3f9aba..827e66c 100644 --- a/openwrt_backup/config.py +++ b/openwrt_backup/config.py @@ -18,8 +18,8 @@ CACHE_DIR = ensure_directory_exists(appdirs.user_cache_dir) CONFIG_FILE_PATH = CONFIG_DIR / "config.toml" PACKAGE_ROOT = Path(__file__).absolute().parent -HOSTNAME = 1 -NUMBER = 0 +HOSTNAME = 0 +NUMBER = 1 if not CONFIG_FILE_PATH.exists(): shutil.copy(PACKAGE_ROOT / "config.toml", CONFIG_FILE_PATH) diff --git a/openwrt_backup/utils.py b/openwrt_backup/utils.py index ed132d0..27dff4d 100755 --- a/openwrt_backup/utils.py +++ b/openwrt_backup/utils.py @@ -72,4 +72,7 @@ def get_next_number(backup_path: Path, hostname): def get_new_backup_filepath(backup_path: Path, time_format, hostname): next_number = get_next_number(backup_path, hostname) dt = datetime.datetime.today() - return backup_path / f"{next_number}__{hostname}__{dt.strftime(time_format)}.tar.gz" + return ( + backup_path + / f"{hostname}__{next_number:03d}__{dt.strftime(time_format)}.tar.gz" + )