Merge pull request #12 from nordic-dev-net:fix-cron-logging

Fix cron job logging, update setup docs
This commit is contained in:
Satu Koskinen 2023-03-18 15:34:02 +02:00 committed by GitHub
commit 44332972f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 3 deletions

View File

@ -81,7 +81,21 @@ nmap --version
If this prints out version information about nmap (e.g. Nmap version 7.93 ( https://nmap.org)), it is installed. Otherwise, installation instructions can be found here: https://nmap.org/download.html If this prints out version information about nmap (e.g. Nmap version 7.93 ( https://nmap.org)), it is installed. Otherwise, installation instructions can be found here: https://nmap.org/download.html
After installing, run the following command (it will ask for your user password, write it and press Enter) to find all devices connected to the local network: After installing nmap, we first need to determine the subnet in which we will search for the Raspberry Pi IP address. This can be done by first determining our host device's IP address:
```
ip a | grep 192.168
```
This should print out something similar to
```
ip a | grep 192.168
inet 192.168.1.117/24 brd 192.168.1.255 scope global dynamic noprefixroute enp3s0
```
Here, 192.168.1.117 is our own IP address. From this, we can deduce our subnet by taking the first three parts of the IP address and replacing the last part with zero, and including the subnet mask (24): `192.168.1.0/24`
Then, run the following command (it will ask for your user password, write it and press Enter) to find all devices connected to the local network, and replace `192.168.1.0/24` with the version with your own IP address:
``` ```
sudo nmap -sn 192.168.1.0/24 sudo nmap -sn 192.168.1.0/24

View File

@ -86,8 +86,8 @@ echo "### Set up a cron job to start the recordings at boot"
echo echo
CRON_FILE=/etc/crontab CRON_FILE=/etc/crontab
CRON_LOG_FILE="$BOOT_DIR_PATH/\$(date +\"%Y-%m-%dT%H-%M-%S\")-cron-log.txt" CRON_LOG_FILE="$BOOT_DIR_PATH/cron-log.txt"
CRON_COMMAND="@reboot root $DIR_PATH/hydrophonitor/scripts/start-all.sh 2>&1 > $CRON_LOG_FILE" CRON_COMMAND="@reboot root $DIR_PATH/hydrophonitor/scripts/start-all.sh 2>&1 >> $CRON_LOG_FILE"
# Append command to cron file only if it's not there yet # Append command to cron file only if it's not there yet
if ! grep -q "$CRON_COMMAND" "$CRON_FILE"; then if ! grep -q "$CRON_COMMAND" "$CRON_FILE"; then