Add device backup

modified:   ../install-little-backup-box.sh
	modified:   rc.py
	modified:   rc.tpl
	renamed:    ../camera-backup.sh -> ../scripts/camera-backup.sh
	renamed:    ../card-backup.sh -> ../scripts/card-backup.sh
	new file:   ../scripts/device-backup.sh
This commit is contained in:
Dmitri Popov
2018-03-22 13:32:34 +01:00
parent 33d0ce8627
commit 8285ef5f40
6 changed files with 77 additions and 14 deletions

View File

@@ -23,9 +23,11 @@ def remote_control():
st = os.statvfs("/home/dmpop")
free = "%.2f" % float((st.f_bavail * st.f_frsize)/1.073741824e9)
if (request.POST.get("cardbackup")):
os.system("sudo /home/pi/little-backup-box/card-backup.sh")
os.system("sudo /home/pi/little-backup-box/scripts/card-backup.sh")
if (request.POST.get("camerabackup")):
os.system("sudo /home/pi/little-backup-box/camera-backup.sh")
os.system("sudo /home/pi/little-backup-box/scripts/camera-backup.sh")
if (request.POST.get("internalbackup")):
os.system("sudo /home/pi/little-backup-box/scripts/device-backup.sh")
if (request.POST.get("shutdown")):
os.system("sudo shutdown -h now")
return template('rc.tpl', freespace=free)

View File

@@ -42,8 +42,10 @@
<p class="center">Free disk space: <b>{{freespace}}</b> GB</p>
<p><input id="btn" name="cardbackup" type="submit" value="Card backup"></p>
<p class="left">Back up a storage card connected via a card reader</p>
<p><input id="btn" class="orange" name="camerabackup" type="submit" value="Camera backup"></p>
<p><input id="btn" name="camerabackup" type="submit" value="Camera backup"></p>
<p class="left">Transfer files directly from the connected camera</p>
<p><input id="btn" class="orange" name="devicebackup" type="submit" value="Internal backup"></p>
<p class="left">Back up files from the internal storage to an external storage device</p>
<p><input id="btn" class="red" name="shutdown" value="Shut down" type="submit" /></p>
<p class="left">Shut down the Little Backup Box</p>
</div>