Web UI -> Remote control. Rename scripts

This commit is contained in:
Dmitri Popov
2018-03-21 07:19:17 +01:00
parent 3f3036881b
commit e13e3a74bc
7 changed files with 22 additions and 20 deletions

View File

@@ -16,7 +16,7 @@ Little Backup Box supports three backup modes:
- **Card backup** Automatically backs up the contents of a storage card to an external storage device.
- **Camera backup** Transfers photos, raw files, and videos from the camera connected directly to the Raspberry Pi. The transferred files are saved in the */home/pi/[CAMERA MODEL]* directory on the system storage card. **Important** Make sure that the camera is set to the MTP USB connection mode.
- **Web UI** Simple web interface that allows you to manually choose one of the two modes described above.
- **Remote control** Provides a simple web interface to manually choose one of the two modes described above.
During the installation, choose the desired mode from the selection dialog.
@@ -26,7 +26,9 @@ When prompted, reboot the Raspberry Pi.
## Usage
In the card backup mode:
The exact backup steps depend on the backup mode.
### Card backup mode
1. Boot the Raspberry Pi
2. Plug in a backup storage device
@@ -37,7 +39,7 @@ To geocorrelate the backed up photos, place a GPX file in the root of the storag
**Note:** To differentiate between different storage cards, the backup script creates a datetime-based *.id* file in the root of each storage card. The name of the *.id* file is also used as the destination backup folder on the storage device.
In the camera backup mode:
### Camera backup mode
1. Boot the Raspberry Pi
2. Connect the camera to the Raspberry Pi
@@ -46,12 +48,12 @@ In the camera backup mode:
Note that the direct camera file transfer script doesn't support geocorrelation.
In the Web UI mode:
### Remote control mode:
1. Point the browser to *http://[IP-ADDRESS]:8080* (replace *[IP-ADDRESS]* with the actual IP address of the Raspberry Pi)
2. Start the desired backup mode by pressing the appropriate button.
<img src="webui.png" alt="" width="375"/>
<img src="rc.png" alt="" width="375"/>
## Problems?

View File

@@ -34,9 +34,9 @@ BACKTITLE="Little Backup Box"
TITLE="Backup mode"
MENU="Select the desired backup mode:"
OPTIONS=(1 "Card Backup"
2 "Camera Backup"
3 "Web UI")
OPTIONS=(1 "Card backup"
2 "Camera backup"
3 "Remote backup")
CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \
@@ -49,19 +49,19 @@ CHOICE=$(dialog --clear \
clear
case $CHOICE in
1)
crontab -l | { cat; echo "@reboot sudo /home/pi/little-backup-box/backup.sh"; } | crontab
crontab -l | { cat; echo "#@reboot sudo /home/pi/little-backup-box/gphoto-backup.sh"; } | crontab
crontab -l | { cat; echo "#@reboot sudo /home/pi/little-backup-box/webui.py"; } | crontab
crontab -l | { cat; echo "@reboot sudo /home/pi/little-backup-box/card-backup.sh"; } | crontab
crontab -l | { cat; echo "#@reboot sudo /home/pi/little-backup-box/camera-backup.sh"; } | crontab
crontab -l | { cat; echo "#@reboot sudo /home/pi/little-backup-box/rc.py"; } | crontab
;;
2)
crontab -l | { cat; echo "#@reboot sudo /home/pi/little-backup-box/backup.sh"; } | crontab
crontab -l | { cat; echo "@reboot sudo /home/pi/little-backup-box/gphoto-backup.sh"; } | crontab
crontab -l | { cat; echo "#@reboot sudo /home/pi/little-backup-box/webui.py"; } | crontab
crontab -l | { cat; echo "#@reboot sudo /home/pi/little-backup-box/card-backup.sh"; } | crontab
crontab -l | { cat; echo "@reboot sudo /home/pi/little-backup-box/camera-backup.sh"; } | crontab
crontab -l | { cat; echo "#@reboot sudo /home/pi/little-backup-box/rc.py"; } | crontab
;;
3)
crontab -l | { cat; echo "#@reboot sudo /home/pi/little-backup-box/backup.sh"; } | crontab
crontab -l | { cat; echo "#@reboot sudo /home/pi/little-backup-box/gphoto-backup.sh"; } | crontab
crontab -l | { cat; echo "@reboot sudo /home/pi/little-backup-box/webui.py"; } | crontab
crontab -l | { cat; echo "#@reboot sudo /home/pi/little-backup-box/card-backup.sh"; } | crontab
crontab -l | { cat; echo "#@reboot sudo /home/pi/little-backup-box/camera-backup.sh"; } | crontab
crontab -l | { cat; echo "@reboot sudo /home/pi/little-backup-box/rc.py"; } | crontab
;;
esac

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

@@ -18,11 +18,11 @@ import os
@route('/')
@route('/', method='POST')
def control():
def remote_control():
if (request.POST.get("cardbackup")):
os.system("sudo /home/pi/little-backup-box/backup.sh")
os.system("sudo /home/pi/little-backup-box/card-backup.sh")
if (request.POST.get("camerabackup")):
os.system("sudo /home/pi/little-backup-box/gphoto-backup.sh")
os.system("sudo /home/pi/little-backup-box/camera-backup.sh")
if (request.POST.get("shutdown")):
os.system("sudo shutdown -h now")
return """