distribution/packages/jelos/sources/scripts/backuptool

31 lines
882 B
Text
Raw Normal View History

2022-02-05 14:23:32 +00:00
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2020-present Shanti Gilbert (https://github.com/shantigilbert)
# Copyright (C) 2020 Fewtarius (https://github.com/fewtarius)
BACKUPFILE="/storage/roms/backup/BACKUP.zip"
mkdir -p "/storage/roms/backup"
case "${1}" in
"restore")
systemctl stop emustation
unzip -o ${BACKUPFILE} -d /
systemctl start emustation
;;
"backup")
[ -f "${BACKUPFILE}" ] && rm "${BACKUPFILE}"
[ -z "$2" ] && systemctl stop emustation
zip -9 -r ${BACKUPFILE} \
/storage/.cache/bluetooth/* \
/storage/.cache/connman* \
/storage/.config/system/configs/system.cfg \
2022-02-05 14:23:32 +00:00
/storage/.emulationstation/es_*.cfg \
/tmp/joypads/* \
/storage/.config/ppsspp/* \
/storage/.config/retroarch/* \
/storage/.emulationstation/scripts/*
[ -z "${2}" ] && systemctl start emustation
;;
esac