background task controls torrent

This commit is contained in:
Christian Rotzoll 2019-04-15 12:34:14 +01:00
parent 08b3432bd3
commit 3f9719b1b4
2 changed files with 16 additions and 19 deletions

View File

@ -172,22 +172,28 @@ do
actualSecondsTimestamp=$(date +%s)
secondsInSync=$(echo "${actualSecondsTimestamp}-"${syncedSince} | bc)
echo "${secondsInSync} seconds"
if [ "${backupTorrentSeeding}" == "on" ]; then
echo "Backup Torrent Seeding is ON - check if already running"
source <(sudo -u admin /home/admin/50torrentHDD.sh status)
if [ "${baseSeeding}" == "0" ] || [ "${updateSeeding}" == "0" ]; then
echo "---> STARTING Backup Torrent Seeding"
sudo -u admin /home/admin/50torrentHDD.sh backup-torrent-hosting
# when >10min in sync
if [ ${secondsInSync} -gt 600 ]; then
echo "LND in sync for longer then 10 minutes"
if [ "${backupTorrentSeeding}" == "on" ]; then
echo "Backup Torrent Seeding is ON - check if already running"
source <(sudo -u admin /home/admin/50torrentHDD.sh status)
if [ "${baseSeeding}" == "0" ] || [ "${updateSeeding}" == "0" ]; then
echo "---> STARTING Backup Torrent Seeding"
sudo -u admin /home/admin/50torrentHDD.sh backup-torrent-hosting
else
echo "Backup Torrent Seeding - already running"
fi
else
echo "Backup Torrent Seeding - already running"
echo "Backup Torrent Seeding is OFF"
fi
else
echo "Backup Torrent Seeding is OFF"
fi
else
echo "still not in sync"
if [ ${syncedSince} -gt 0 ]; then
echo "was in sync at least once since rinning but lost now for:"
actualSecondsTimestamp=$(date +%s)
secondsOutOfSync=$(echo "${actualSecondsTimestamp}-"${syncedSince} | bc)

View File

@ -435,14 +435,5 @@ sed -i "s/^state=.*/state=stresstest/g" ${infoFile}
sed -i "s/^message=.*/message='Testing Hardware 60s'/g" ${infoFile}
sudo /home/admin/config.scripts/blitz.stresstest.sh /home/admin/stresstest.report
################################
# BACKUP TORRENT SEEDING
################################
if [ "${backupTorrentSeeding}" == "on" ]; then
echo "Starting BACKUP TORRENT HOSTING in background (after 6 hours) ..." >> $logFile
( sleep 6h ; sudo -u admin /home/admin/50torrentHDD.sh backup-torrent-hosting ) &
fi
echo "DONE BOOTSTRAP" >> $logFile
exit 0