D-Link Forums

The Graveyard - Products No Longer Supported => IP Cameras => DCS-2330L => Topic started by: Tartina on September 20, 2015, 11:05:03 AM

Title: Automatically create date-hours folders on fto?
Post by: Tartina 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
Title: Re: Automatically create date-hours folders on fto?
Post by: cmontyburns on September 20, 2015, 04:25:35 PM
Not using the camera.  It will simply FTP files into the folder you tell it to.
Title: Re: Automatically create date-hours folders on fto?
Post by: grockk 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
Title: Re: Automatically create date-hours folders on fto?
Post by: cmontyburns 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.