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. - **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. - **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. During the installation, choose the desired mode from the selection dialog.
@@ -26,7 +26,9 @@ When prompted, reboot the Raspberry Pi.
## Usage ## Usage
In the card backup mode: The exact backup steps depend on the backup mode.
### Card backup mode
1. Boot the Raspberry Pi 1. Boot the Raspberry Pi
2. Plug in a backup storage device 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. **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 1. Boot the Raspberry Pi
2. Connect the camera to 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. 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) 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. 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? ## Problems?

View File

@@ -34,9 +34,9 @@ BACKTITLE="Little Backup Box"
TITLE="Backup mode" TITLE="Backup mode"
MENU="Select the desired backup mode:" MENU="Select the desired backup mode:"
OPTIONS=(1 "Card Backup" OPTIONS=(1 "Card backup"
2 "Camera Backup" 2 "Camera backup"
3 "Web UI") 3 "Remote backup")
CHOICE=$(dialog --clear \ CHOICE=$(dialog --clear \
--backtitle "$BACKTITLE" \ --backtitle "$BACKTITLE" \
@@ -49,19 +49,19 @@ CHOICE=$(dialog --clear \
clear clear
case $CHOICE in case $CHOICE in
1) 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/card-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/camera-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/rc.py"; } | crontab
;; ;;
2) 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/card-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/camera-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/rc.py"; } | crontab
;; ;;
3) 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/card-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/camera-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/rc.py"; } | crontab
;; ;;
esac 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('/')
@route('/', method='POST') @route('/', method='POST')
def control(): def remote_control():
if (request.POST.get("cardbackup")): 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")): 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")): if (request.POST.get("shutdown")):
os.system("sudo shutdown -h now") os.system("sudo shutdown -h now")
return """ return """