Initial commit - clean repository without history
This commit is contained in:
27
script.py
Executable file
27
script.py
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/python3
|
||||
import argparse
|
||||
from functions import *
|
||||
|
||||
default_backup_dir()
|
||||
|
||||
parser = argparse.ArgumentParser(description="Backup script")
|
||||
parser.add_argument("-s", "--show", action="store_true", help="Show enabled paths")
|
||||
parser.add_argument("-d", "--debug", action="store_true", help="Enable debug")
|
||||
parser.add_argument("-c", "--check", action="store_true", help="Check the declared path info")
|
||||
parser.add_argument("-r", "--rotate", action="store_true", help="Rotate the backups")
|
||||
parser.add_argument("--dry", action="store_true", help="Dry run for rotate: show what would be deleted (no deletion)")
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.show:
|
||||
show_enabled()
|
||||
elif args.debug:
|
||||
backups_now(debug="on")
|
||||
elif args.check:
|
||||
checked = check_existing_folders(debug="on")
|
||||
#print(checked)
|
||||
elif args.rotate:
|
||||
# passa il flag dry al chiamante; default è delete se non specifichi --dry
|
||||
autorotate_backups(dry_run=args.dry)
|
||||
else:
|
||||
backups_now()
|
||||
autorotate_backups()
|
||||
Reference in New Issue
Block a user