1
0
Fork 0
borgbackup_on_android/borg.sh

30 lines
1.1 KiB
Bash
Raw Normal View History

2017-12-07 17:50:26 +01:00
#!/data/data/com.termux/files/usr/bin/bash
export BORG_RSH=borg_ssh_wrapper
source /data/data/com.termux/files/home/borgbackup_on_android/borg-env/bin/activate
# 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@<server>:<port>/./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