Alert image with unique filename using macro

Post Reply
JayUK
Posts: 2
Joined: Mon Feb 17, 2020 12:05 pm

Alert image with unique filename using macro

Post by JayUK »

Hi all,

I have BI configured to FTP the alert image file to two different servers, which I want to have the same unique filename.

There are two FTP entries under the alerts tab for the camera, one for each server

Both are configured to FTP the file using the following filename: &CAM_%H-%M-%S_%d-%m-%y

But unfortunately the %H-%M-%S_%d-%m-%y macro is of the system time and not the alert image time. This means the the second FTP transfer has a different filename to the first one (different by a second or two). Removing the second aspect of the filename wont help, as the time might have rolled on to the next minute.

Can anyone suggest a suitable BI macro/variable I could use? (I've tried the ALERT_DB and ALERT_CLIP macros/variables, but they have either been blank or not unique/invalid for a filename).

Thanks,

J.
User avatar
YrbkMgr
Posts: 587
Joined: Sun Nov 24, 2019 12:56 am
Location: Chicagoland

Re: Alert image with unique filename using macro

Post by YrbkMgr »

But unfortunately the %H-%M-%S_%d-%m-%y macro is of the system time and not the alert image time. This means the the second FTP transfer has a different filename to the first one (different by a second or two). Removing the second aspect of the filename wont help, as the time might have rolled on to the next minute.
Someone said to me "in order to get from here to there, we have to know where you are". Same thing applies here. What I mean to say is, how are you getting the alert image to two servers now? And for the sake of clarity, do you mean two different BI servers or FTP servers?

You can upload to FTP several ways:
1. Camera Settings -> Post
2. Camera Settings -> Alert Actions
3. Camera Settings -> Trigger -> Immediate Actions
4. Global Settings -> Clips & Archiving

How you do it is driven by what you're after. For example, do you need real time post to FTP, or is your goal backup redundancy like two different folders on the same FTP server? Or two completely different FTP servers? In my opinion, any reliance on macros for timestamp is misleading. All the information you are trying to get via macro is the filename of the alert image already. No need for macros.

Seems to me that if you want to assure the same filename, pull from one location - Alerts folder. One strategy is to real time FTP just like you're doing now, but to only one FTP server. Then use Clips & Archiving policies to FTP everything in the Alerts folder when retention parameters are met. In that scenario, you would have real-time uploads to one FTP, then later upload All alerts to the second FTP. If the critical function is "same filename", FTP the alerts folder to the second server.

I'm just spitballin' ideas based on what little I know about the objective - the use case, as it were. The only way I can envision complete redundancy is manipulating the Alerts folder contents because the filenames there offer granular timestamp information.
BI Alerts Folder Filename 1.jpg
BI Alerts Folder Filename 1.jpg (102.99 KiB) Viewed 1143 times
  • "Whenever I take something apart to fix it and put it back together again, I end up with like six really important looking pieces left over" -Tim Allen
  • If you know what your after, you'll recognize it when you see it.
User avatar
muzicman0
Posts: 17
Joined: Thu Dec 23, 2021 4:45 pm

Re: Alert image with unique filename using macro

Post by muzicman0 »

If I was doing this, I would only copy to 1 FTP server, then sync the files from the 1st FTP server to the second. so:

1. FTP the alert image to FTP Server #1
2. FTP Server #1 has a script that monitors for new files
3. Once new files are found, they are copied to FTP server #2

If you are using anything like a NAS, then they have typical backup applications that could automate this (although, typically on a schedule). But you could run these backup tasks every hour if you wanted.

Another option would be to use something like OneDrive to automate this as well. Have BI copy your Alert image to a sync'd OneDrive folder, which will auto upload and become available on all other sync'd devices.
User avatar
YrbkMgr
Posts: 587
Joined: Sun Nov 24, 2019 12:56 am
Location: Chicagoland

Re: Alert image with unique filename using macro

Post by YrbkMgr »

Agreed. That's what I was driving at with the added wrinkle of using the Alerts folder as the source as a batched process. If redundancy is part of the objective, that's the best location for uniformity in file names.
  • "Whenever I take something apart to fix it and put it back together again, I end up with like six really important looking pieces left over" -Tim Allen
  • If you know what your after, you'll recognize it when you see it.
Post Reply