2022-04-03 16:38:59 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Copyright (C) 2020-present Fewtarius
|
|
|
|
|
|
|
|
CONFIGPATH="/storage/.config"
|
|
|
|
|
|
|
|
if [ -e "${CONFIGPATH}/rsync.conf" ]
|
|
|
|
then
|
|
|
|
source ${CONFIGPATH}/rsync.conf
|
|
|
|
else
|
|
|
|
MOUNTPATH="/storage/cloud"
|
|
|
|
SYNCPATH="GAMES"
|
|
|
|
BACKUPPATH="/storage/roms"
|
|
|
|
fi
|
2022-04-03 17:46:03 +00:00
|
|
|
|
|
|
|
echo -e "=> ${OS_NAME} CLOUD RESTORE UTILITY\n" >/dev/console
|
|
|
|
|
|
|
|
echo "Mounting ${MOUNTPATH}" >/dev/console 2>&1
|
|
|
|
rclonectl mount ${MOUNTPATH} >/dev/console 2>&1
|
|
|
|
|
|
|
|
echo "Restoring data from ${MOUNTPATH}/${SYNCPATH} to ${BACKUPPATH}" >/dev/console 2>&1
|
|
|
|
rsync -raiv --include-from="${CONFIGPATH}/rsync-rules.conf" ${MOUNTPATH}/${SYNCPATH}/ ${BACKUPPATH}/ >/dev/console 2>&1
|
|
|
|
|
|
|
|
echo "Unmounting ${MOUNTPATH}" >/dev/console 2>&1
|
|
|
|
rclonectl unmount ${MOUNTPATH} >/dev/console 2>&1
|
|
|
|
sleep 3
|
|
|
|
clear >/dev/console
|