-
Notifications
You must be signed in to change notification settings - Fork 2
/
pseudo-dvr-code.txt
27 lines (25 loc) · 1.04 KB
/
pseudo-dvr-code.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# Pseudo-code for camera DVR to create alert notifications and send video to Pi for edge computing
# live streaming can be viewed by accessing a DVR hosted IP address
i=$FALSE
Do {
if (folder-for-motion-capture is created) {
$timedate = get-time & get-date
mkdir $timedate
touch .\$timedate\$timedate-notification.txt
ftp .\$timedate\$timedate-notification.txt [email protected] -p <PASSWORD>
# this sends a quick notification to the pi to allow even faster farmer notification
# Need to research how to encrypt the password locally for auto-ftping. FTP is not encrypted
Do {
ftp -r finished-motion-capture [email protected] -p <PASSWORD>
} Until (motion-capture-folder has not been written to)
# aka once the entire motion event occurs, then move it over.
# we can always compress the file
if ($TIME == 0 or 6 or 12 or 18) {
ftp -r all-the-live-files [email protected] -p <PASSWORD>
# except the latest files as we could cause data corruption
}
if (video/motion files are older than three days) {
rm -rf video-files
}
} Until (i=$TRUE)