зеркало из https://github.com/Azure/azfilebackup.git
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
Коммит
a4271b54c6
|
@ -5,4 +5,3 @@
|
|||
/config.txt
|
||||
*.pyc
|
||||
/*.log
|
||||
/asebackupcli.egg-info
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
## Install the executable in a user account using `virtualenv`
|
||||
|
||||
```
|
||||
curl https://raw.githubusercontent.com/chgeuer/azfilebak/master/install_userspace.sh | bash
|
||||
curl --silent https://raw.githubusercontent.com/chgeuer/azfilebak/master/install_userspace.sh | bash
|
||||
|
||||
sudo $HOME/bin/azfilebak -c $HOME/azfilebak.config -f --force
|
||||
```
|
||||
|
|
|
@ -235,7 +235,7 @@ class BackupAgent:
|
|||
stripe_count=stripe_count, output_dir=output_dir, container_name=temp_container_name)
|
||||
logging.debug("Start streaming backup SQL call")
|
||||
try:
|
||||
stdout, stderr, returncode = self.executable_connectorector.create_backup_streaming(
|
||||
stdout, stderr, returncode = self.executable_connector.create_backup_streaming(
|
||||
dbname=dbname, is_full=is_full, stripe_count=stripe_count,
|
||||
output_dir=output_dir)
|
||||
except BackupException:
|
||||
|
@ -291,7 +291,7 @@ class BackupAgent:
|
|||
out("Skipping backup of database {}".format(dbname))
|
||||
return
|
||||
|
||||
stripe_count = self.executable_connectorector.determine_database_backup_stripe_count(dbname=dbname, is_full=is_full)
|
||||
stripe_count = self.executable_connector.determine_database_backup_stripe_count(dbname=dbname, is_full=is_full)
|
||||
|
||||
backup_exception=None
|
||||
try:
|
||||
|
@ -338,7 +338,7 @@ class BackupAgent:
|
|||
logging.fatal(message)
|
||||
raise BackupException(message)
|
||||
|
||||
ddl_content = self.executable_connectorector.create_ddlgen(dbname=dbname)
|
||||
ddl_content = self.executable_connector.create_ddlgen(dbname=dbname)
|
||||
ddlgen_file_name=Naming.construct_ddlgen_name(dbname=dbname, start_timestamp=start_timestamp)
|
||||
self.backup_configuration.storage_client.create_blob_from_text(
|
||||
container_name=self.backup_configuration.azure_storage_container_name,
|
||||
|
@ -455,7 +455,7 @@ class BackupAgent:
|
|||
|
||||
def restore(self, restore_point, output_dir, databases):
|
||||
print("Retriving point-in-time restore {} for databases {}".format(restore_point, str(databases)))
|
||||
databases = self.executable_connectorector.determine_databases(user_selected_databases=databases, is_full=True)
|
||||
databases = self.executable_connector.determine_databases(user_selected_databases=databases, is_full=True)
|
||||
skip_dbs = self.backup_configuration.get_databases_to_skip()
|
||||
databases = filter(lambda db: not (db in skip_dbs), databases)
|
||||
for dbname in databases:
|
||||
|
|
|
@ -34,7 +34,7 @@ class Runner:
|
|||
requiredNamed.add_argument("-c", "--config", help="the path to the config file")
|
||||
|
||||
commands = parser.add_argument_group("commands")
|
||||
commands.add_argument("-f", "--full-backup", help="Perform full backup", action="store_true")
|
||||
commands.add_argument("-f", "--full-backup", help="Perform backup for configuration")
|
||||
commands.add_argument("-r", "--restore", help="Perform restore for date")
|
||||
commands.add_argument("-l", "--list-backups", help="Lists all backups in Azure storage", action="store_true")
|
||||
commands.add_argument("-p", "--prune-old-backups", help="Removes old backups from Azure storage ('--prune-old-backups 30d' removes files older 30 days)")
|
||||
|
@ -143,9 +143,7 @@ class Runner:
|
|||
backup_configuration = BackupConfiguration(config_file)
|
||||
backup_agent = BackupAgent(backup_configuration)
|
||||
output_dir = Runner.get_output_dir(args)
|
||||
databases = Runner.get_databases(args)
|
||||
|
||||
use_streaming=args.stream_upload
|
||||
skip_upload=args.skip_upload
|
||||
force=args.force
|
||||
|
||||
|
@ -156,7 +154,7 @@ class Runner:
|
|||
try:
|
||||
#is_full, databases, output_dir, force, skip_upload, use_streaming
|
||||
with pid.PidFile(pidname='files-backup-full', piddir=".") as _p:
|
||||
backup_agent.backup(is_full=True, databases=databases, output_dir=output_dir, force=force, skip_upload=skip_upload, use_streaming=use_streaming)
|
||||
backup_agent.backup(databases=databases, output_dir=output_dir, force=force, skip_upload=skip_upload, backup_configuration=args.full_backup)
|
||||
except pid.PidFileAlreadyLockedError:
|
||||
logging.warn("Skip full backup, already running")
|
||||
elif args.restore:
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
azure.storage.account_name: sadjfksjlahfkj
|
||||
azure.storage.container_name: immutab
|
||||
local_temp_directory: /tmp
|
||||
notification_command: /usr/sbin/ticmcmc --stdin
|
||||
|
||||
commandline.tmp_dir: tar cvfz - /tmp
|
||||
commandline.everything: tar cvfz - / --exclude=/dev --exclude=/proc --exclude=/run --exclude=/sys
|
||||
commandline.someecho: echo "hallo"
|
||||
|
||||
#
|
||||
# $ azbackup --config-file /etc/azfileback --configurion-key==everything
|
||||
#
|
|
@ -1,6 +0,0 @@
|
|||
# Some comment
|
||||
|
||||
local_temp_directory: /tmp
|
||||
notification_command: /usr/sbin/ticmcmc --stdin
|
||||
azure.storage.account_name: sadjfksjlahfkj
|
||||
azure.storage.container_name: immutab
|
Загрузка…
Ссылка в новой задаче