diff --git a/borg.sh b/borg.sh index 7474b83..93f1b29 100644 --- a/borg.sh +++ b/borg.sh @@ -1,9 +1,29 @@ #!/data/data/com.termux/files/usr/bin/bash -t=`date +%d_%m_%Y` -export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes -export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes -host=angler -dirs="/ /system /vendor /cache /persist /firmware /storage /data" export BORG_RSH=borg_ssh_wrapper source /data/data/com.termux/files/home/borgbackup_on_android/borg-env/bin/activate -borg create -C lz4 -p -v --stats --one-file-system backup:/backup/borg/$host::$t $dirs # 2> ~/borg_backup_${t}.err + + +# Avoid UnicodeError +export LANG=en_US.UTF-8 + +# Ask an external program to supply the repository passphrase: +export BORG_PASSCOMMAND="cat /data/data/com.termux/files/home/borgbackup_on_android/borg-passphrase" + +# Set repository location +export BORG_REPO=ssh://borg@:/./auto + +# Initialize remote repository (doesn't matter if it already is). +borg init --encryption=repokey-blake2 + +borg create \ + --filter AME \ + --compression lz4 \ + --remote-ratelimit 0 \ + \ + --exclude-caches \ + --exclude '/data/data/*/cache' \ + --exclude '/data/data/*/code_cache' \ + --exclude '/data/data/*/no_backup' \ + --exclude '**/TWRP/BACKUPS' \ + ::'{hostname}-{utcnow}' \ + /system /data /storage