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