Script to create database entries of files received via FTP
$30-250 USD
Lezárt
Kiadva ekkor: több mint 6 évvel ezelőtt
$30-250 USD
Teljesítéskor fizetve
We would like to provide videos coming from cameras via FTP on a website. Website and database already exist, so that the job is very simple: whenever a new FTP-Transfer has finished the script shall make a database entry containing filename, date, time, cam-id and transfer that .avi file to a target directory using a new filename which is determined from the db-entry.
db-structure table security:
CREATE TABLE "security" (
camera integer,
filename character(80) NOT NULL,
frame integer,
file_type integer,
time_stamp timestamp(6) without time zone,
text_event character(40),
event_time_stamp character varying(14)
)
Example of db entries
camera | filename | frame | file_type | time_stamp | text_event | event_time_stamp
--------+----------------------------------------------------------------------------------+-------+-----------+---------------------+------------+------------------
3 | /home/sosobserve/htdocs/gallery/img/3/2017/06/23/[login to view URL] | 3 | 1 | 2017-06-23 14:00:32 | | 20170623135948
3 | /home/sosobserve/htdocs/gallery/vid/3/2017/06/23/[login to view URL] | 2 | 8 | 2017-06-23 14:02:24 | | 20170623140224
3 | /home/sosobserve/htdocs/gallery/img/3/2017/06/23/[login to view URL] | 0 | 1 | 2017-06-23 14:03:22 | | 20170623140224
3 | /home/sosobserve/htdocs/gallery/vid/3/2017/06/23/[login to view URL] | 2 | 8 | 2017-06-23 14:05:22 | | 20170623140522
3 | /home/sosobserve/htdocs/gallery/img/3/2017/06/23/[login to view URL] | 2 | 1 | 2017-06-23 14:07:27 | | 20170623140522
3 | /home/sosobserve/htdocs/gallery/vid/3/2017/06/23/[login to view URL] | 3 | 8 | 2017-06-23 14:15:58 | | 20170623141558
origin of data
camera ---> values 1,2,3,4.... determined from the directory name where the respective ftp-files arrive
filename ---> full path of file in target directory - path comes from a config file
frame ---> value 2 should do it for the moment
file_type ---> value 1 for .avi file
time_stamp ----> time when ftp files arrival has completed
text_event ---> empty
event_time_stamp --> same value as time_stamp - different format