change filenames for possible unifying
This commit is contained in:
@@ -9,7 +9,7 @@ import subprocess
|
||||
import sys
|
||||
from argparse import ArgumentParser
|
||||
|
||||
VERSION = "0.0.9"
|
||||
VERSION = "0.1.0"
|
||||
|
||||
|
||||
class TB:
|
||||
@@ -256,8 +256,8 @@ def get_opts():
|
||||
"--tar-file",
|
||||
type=str,
|
||||
dest="tar_file",
|
||||
default="backup.tar",
|
||||
help="filename for backups. Use correct extension, e.g. tgz if necessary. Defaults: '%(default)s'",
|
||||
default=None,
|
||||
help="filename for backups. Use correct extension, e.g. tgz if necessary. Defaults to [backup_write_folder].tar",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--ssh-args",
|
||||
@@ -292,6 +292,10 @@ def get_opts():
|
||||
parser.add_argument("backup_source", action="store", help="Source folder to backup with tar+ssh")
|
||||
parser.add_argument("base_folder", action="store", help="Local backup folder written to")
|
||||
options = parser.parse_args()
|
||||
if options.tar_file is None:
|
||||
options.tar_file = os.path.basename(options.base_folder.rstrip("/")) + ".tar"
|
||||
if options.gpg:
|
||||
options.tar_file += ".gpg"
|
||||
if "/" in options.tar_file:
|
||||
parser.error("--tar-file must be a filename")
|
||||
return options
|
||||
|
||||
Reference in New Issue
Block a user