Safer BT_backup migration

Backup /config/qBittorrent/BT_backup/ before we copy anything
Rename /config/data/qBittorrent/BT_backup/ after copy so we don't do it again.
This commit is contained in:
Adam 2021-02-13 13:18:26 +00:00 committed by GitHub
parent b1d457d6cf
commit 5bb96a4860
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,10 @@ mkdir -p /config/qBittorrent
# v4.3.3 BT_backup migration
[[ -d /config/data/qBittorrent/BT_backup/ ]] && \
cp -a /config/data/qBittorrent/BT_backup/. /config/qBittorrent/BT_backup/
mv /config/qBittorrent/BT_backup/ /config/qBittorrent/BT_backup.bak/ && \
mkdir /config/qBittorrent/BT_backup/ && \
cp -a /config/data/qBittorrent/BT_backup/. /config/qBittorrent/BT_backup/ && \
mv /config/data/qBittorrent/BT_backup/ /config/data/qBittorrent/BT_backup.old/
# chown download directory if currently not set to abc
if [[ "$(stat -c '%U' /downloads)" != "abc" ]]; then