• October 21, 2019, 05:17:29 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

This Forum Beta is ONLY for registered owners of D-Link products in the USA for which we have created boards at this time.

Author Topic: Automatically create date-hours folders on fto?  (Read 1365 times)

Tartina

  • Level 1 Member
  • *
  • Posts: 3
Automatically create date-hours folders on fto?
« on: September 20, 2015, 11:05:03 AM »

Hi,
Is there a way for 2330L to automatically create folders with date-hours on ftp/NAS, like on SD card? (or like the DCS-942L is doing via ftp?)
It would be extremely easy to navigate folders, instead of having e.g. a unique folder with 100k files
Thank you
« Last Edit: September 20, 2015, 04:24:09 PM by Tartina »
Logged

cmontyburns

  • Level 3 Member
  • ***
  • Posts: 194
Re: Automatically create date-hours folders on fto?
« Reply #1 on: September 20, 2015, 04:25:35 PM »

Not using the camera.  It will simply FTP files into the folder you tell it to.
Logged

grockk

  • Level 1 Member
  • *
  • Posts: 3
Re: Automatically create date-hours folders on fto?
« Reply #2 on: November 20, 2015, 07:18:06 AM »

Here's my workaround for this.

Take this code in notepad and save it as a .ps1 file. (note the extension is P S "ONE" not L or l or I or i. I screwed that up when I first did this.)

Code: [Select]
function doTheSort([string]$SourceDir, [string]$DestinationDir) {
    $files = get-childitem $SourceDir *.*
 
    foreach ($file in $files)
    {
        $Directory = $DestinationDir + "" + $file.CreationTime.Date.ToString('yyyy-MM-dd')
 
        if (!(Test-Path $Directory))
        {
            New-Item $directory -type directory
        }
        Move-Item $file.fullname $Directory
    }
}
 
doTheSort "c:\camera\Today\" "c:\camera\"

Here I have my FTP target as "C:\cameras\Today" sorted by date into flders like "C:\camera\2015-11-19".

To run the .ps1 file without all the security prompts and stuff, make a .bat file in notepad like this
Code: [Select]
Powershell -Executionpolicy bypass -File C:\camera\sort.ps1
Logged

cmontyburns

  • Level 3 Member
  • ***
  • Posts: 194
Re: Automatically create date-hours folders on fto?
« Reply #3 on: November 20, 2015, 04:57:34 PM »

Hi,
Is there a way for 2330L to automatically create folders with date-hours on ftp/NAS, like on SD card? (or like the DCS-942L is doing via ftp?)
It would be extremely easy to navigate folders, instead of having e.g. a unique folder with 100k files
Thank you

For network storage, the camera does do this.  Top level folder will be whatever you specify.  Inside that, the camera will create a video folder.  Inside that, it creates folders by date, and inside each one of those it creates individual folders for each hour. 
Logged