This commit is contained in:
parent
1f8d77b98d
commit
58ea766027
@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/ash
|
||||||
: "${RESTIC_REPOSITORY:?Need the restic repository}"
|
: "${RESTIC_REPOSITORY:?Need the restic repository}"
|
||||||
: "${AWS_ACCESS_KEY_ID:?Need the access key id}"
|
: "${AWS_ACCESS_KEY_ID:?Need the access key id}"
|
||||||
: "${AWS_SECRET_ACCESS_KEY:?Need the secret access key}"
|
: "${AWS_SECRET_ACCESS_KEY:?Need the secret access key}"
|
||||||
|
@ -90,16 +90,17 @@ if db_dump:
|
|||||||
os.system(f'mariadb-dump -h {db_dump_host} -u {db_dump_user} -p{db_dump_password} --skip-opt\
|
os.system(f'mariadb-dump -h {db_dump_host} -u {db_dump_user} -p{db_dump_password} --skip-opt\
|
||||||
{database} > {db_dump_tmp_path}{database}.{now.strftime("%m-%d-%Y_%H-%M-%S")}.sql')
|
{database} > {db_dump_tmp_path}{database}.{now.strftime("%m-%d-%Y_%H-%M-%S")}.sql')
|
||||||
|
|
||||||
# Local rclone backup
|
# Create the config
|
||||||
if rclone_copy:
|
|
||||||
os.system(f'rclone sync -P {seafile_data_local} {seafile_data_backup}')
|
|
||||||
|
|
||||||
if rclone_config_create:
|
if rclone_config_create:
|
||||||
rclone_config_check = str(subprocess.check_output(["rclone", "config", "file"]))
|
rclone_config_check = str(subprocess.check_output(["rclone", "config", "file"]))
|
||||||
if "doesn't exist" in rclone_config_check:
|
if "doesn't exist" in rclone_config_check:
|
||||||
os.system(f"rclone config create {rclone_remote} {rclone_backend} provider={rclone_provider}\
|
os.system(f"rclone config create {rclone_remote} {rclone_backend} provider={rclone_provider}\
|
||||||
endpoint={rclone_endpoint} env_auth=true")
|
endpoint={rclone_endpoint} env_auth=true")
|
||||||
|
|
||||||
|
# Local rclone backup
|
||||||
|
if rclone_copy:
|
||||||
|
os.system(f'rclone sync -P {seafile_data_local} {seafile_data_backup}')
|
||||||
|
|
||||||
# Remote rclone backup
|
# Remote rclone backup
|
||||||
if rclone_push:
|
if rclone_push:
|
||||||
os.system(f'rclone sync -P {seafile_data_local} {rclone_remote}:{rclone_remote_path}')
|
os.system(f'rclone sync -P {seafile_data_local} {rclone_remote}:{rclone_remote_path}')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user