20 lines
527 B
Plaintext
Executable File
20 lines
527 B
Plaintext
Executable File
#!/usr/bin/with-contenv bash
|
|
|
|
# Check, if a configuration directory exists
|
|
cp /etc/plexdrv/rclone.conf /root/.rclone.conf
|
|
if [[ -d /config/Library ]]
|
|
then
|
|
echo "Configuration found, skipping restore of backup"
|
|
else
|
|
if rclone ls $BACKUP/pms.tar.gz
|
|
then
|
|
echo "No configuration found, restoring backup..."
|
|
rclone copy $BACKUP/pms.tar.gz / --verbose --transfers 4 --checkers 20 --stats 10s
|
|
cd /config
|
|
tar -xvzf /pms.tar.gz
|
|
fi
|
|
fi
|
|
|
|
echo "0 $CRON * * * /root/bin/backup-pms" > /root/crontab.txt
|
|
crontab /root/crontab.txt
|