This commit is contained in:
dave 2022-12-08 23:02:17 -08:00
commit 10aaa9009f
4 changed files with 59 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
.DS_Store
__pycache__
resticbackup.egg-info/
testenv/
test_data/

0
resticbackup/__init__.py Normal file
View File

34
resticbackup/cli.py Normal file
View File

@ -0,0 +1,34 @@
def load_configs():
# load configs from /etc/resticbackup.d/
# we have special handling for /etc/resticbackup.d/main.json
# return (main_config, dict(config_name=>config))
pass
def cmd_backup(args, parser):
config, backup_configs = load_configs()
try:
backup_config = backup_configs[args.name]
except KeyError:
parser.error("invalid backup name: '{}'".format(args.name))
# perform pre-exec
# perform backup
# perform post-exec
def cmd_restore(args, parser):
pass # TODO
def main():
print("welcome 2 resticbackup")
pass
if __name__ == '__main__':
main()

20
setup.py Normal file
View File

@ -0,0 +1,20 @@
from setuptools import setup
__version__ = "0.0.0"
setup(name='resticbackup',
version=__version__,
description='Wrapper around restic for automated backups',
url='',
author='dpedu',
author_email='dave@davepedu.com',
packages=['resticbackup'],
install_requires=[],
entry_points={
"console_scripts": [
"resticbackup = resticbackup.cli:main",
]
},
zip_safe=False)