Browse Source

Merge pull request #1 from reynico/master

Update to my fork
pull/90/head
Mihajlo Petković 4 years ago
committed by GitHub
parent
commit
7af70638c6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 5 deletions
  1. +7
    -0
      WORKING.md
  2. +1
    -1
      install.sh
  3. +7
    -4
      prune.sh

+ 7
- 0
WORKING.md View File

@@ -34,3 +34,10 @@ Will show the scheduled jobs for today, each job can be described using `at -c <


# Images # Images
Images are saved in the web server's directory, so you can access your received images at http://your.raspberry.pi.ip/, where `your.raspberry.pi.ip` is your Raspberry PI IP address. Images are saved in the web server's directory, so you can access your received images at http://your.raspberry.pi.ip/, where `your.raspberry.pi.ip` is your Raspberry PI IP address.

# Pruning
Run `prune.sh` to delete old images. By default it deletes the 10 oldest images from the disk and the database. If you want to schedule this task, run

```bash
cat <(crontab -l) <(echo "1 0 * * * /home/pi/raspberry-noaa/prune.sh") | crontab -
```

+ 1
- 1
install.sh View File

@@ -184,7 +184,7 @@ log_running "Setting up Nginx..."
sudo cp templates/nginx.cfg /etc/nginx/sites-enabled/default sudo cp templates/nginx.cfg /etc/nginx/sites-enabled/default
( (
sudo mkdir -p /var/www/wx/images sudo mkdir -p /var/www/wx/images
sudo chown -R www-data:www-data /var/www/wx
sudo chown -R pi:pi /var/www/wx
sudo usermod -a -G www-data pi sudo usermod -a -G www-data pi
sudo chmod 775 /var/www/wx sudo chmod 775 /var/www/wx
) )


+ 7
- 4
prune.sh View File

@@ -4,7 +4,10 @@
. "$HOME/.noaa.conf" . "$HOME/.noaa.conf"
. "$NOAA_HOME/common.sh" . "$NOAA_HOME/common.sh"


find "${NOAA_HOME}/map/" -type f -name '*.png' -mtime +1 -exec rm -f {} \;
log "${NOAA_HOME}/map/ folder pruned" "INFO"
find "${NOAA_OUTPUT}/audio/" -type f -name '*.wav' -mtime +1 -exec rm -f {} \;
log "${NOAA_OUTPUT}/audio/ folder pruned" "INFO"
for img_path in $(sqlite3 ${NOAA_HOME}/panel.db "select file_path from decoded_passes limit 10;"); do
find "${NOAA_OUTPUT}/images/" -type f -name "${IMG_NAME}*.jpg" -exec rm -f {} \;
find "${NOAA_OUTPUT}/images/thumb/" -type f -name "${IMG_NAME}*.jpg" -exec rm -f {} \;
log "${img_path} file pruned" "INFO"
sqlite3 "${NOAA_HOME}/panel.db" "delete from decoded_passes where file_path = \"$img_path\";"
log "Database entry pruned" "INFO"
done

Loading…
Cancel
Save