Jump to content
simyf

Tool, Software or scripts to auto backup daily video file

Recommended Posts

Dear All,

Need advise about any tools, softwares or scripts that can perform auto backup daily video files to external storage... thanks

Share this post


Link to post
Share on other sites

rsync/ssh is what we use, but that Linux. I guess an FTP program like WS_FTP Pro would work. Of course... I have never heard of FOSI nor do I know how to kickyou.to their site

Share this post


Link to post
Share on other sites

The daily video file will create one folder and the format is like d:\d20050705, so can the ws_ftp pro auto pickup the daily folder and transfer/copy it to external storage.?

Share this post


Link to post
Share on other sites

Anyone have experience to auto backup the daily video files to external storage? Appreciate you can share with me. Thanks.

Share this post


Link to post
Share on other sites

Cant you use External Raid?? Or are you trying to archive to something like a CDR or DVDR ... ?

Share this post


Link to post
Share on other sites

I need some advise on any tools, utility or software to auto backup daily video files to external hard disk/storage....

Share this post


Link to post
Share on other sites

What type of external storage though .. and what DVR is it again ..?

 

I can write a simple vbscript for you and then you have windows scheduling run it whenever you want it to. Just need to know what DVR, and what storage device.

 

Rory

Share this post


Link to post
Share on other sites

Vguard PC Base DVR and the directory structure of daily video files will be stored at d:\database\d200507012 (dyearmonthdate) and I want to backup to another network drive f:\

Share this post


Link to post
Share on other sites

will that drive have adequate storage, and will drive f: be mapped so I can just copy to f:?

 

Rory

Share this post


Link to post
Share on other sites

okay give me a few minutes, I wrote something to copy to the E drive recently, ill see if I can find it.

Share this post


Link to post
Share on other sites

what file extensions are they?AVI? And what is the letter d stand for, is it the same on every file?

Share this post


Link to post
Share on other sites

the file extension is *.vgz and everyday the software will create one folder start with Dyearmonthdate and for today the folder willbe D20050712

Share this post


Link to post
Share on other sites

do they have other folders under it, like camera numbers, such as cam01, cam02, or 01, 02, etc, or just the .vgz files?

 

anyway, the following will copy all .vgz files under the main folder of the day, not sub folders (that can be done also just let me know). Copy and paste this into a text file, then raname it archive.vbs (or whatever you want to name it, once it is a .vbs extension).

 

The firtst line, change "f" for the drive you want to back up to.

 

Run it to test it first. Once it works and copies all the files, then use windows scheduling to run the file once every day.

 

Also, for this to work if you run Nortons, you will need to disable Script blocking. If you dont want to do that, I can throw it in an exe and have that run in the back ground.

 

If the drive does not exist it will just do nothing.

 

'-----------------------------------------------------------------

 

CONST bDrive = "f"

 

DIM bMonth

DIM bFile

DIM fpath

 

On Error Resume Next

 

bMonth = Month(Date)

IF Instr(1,bMonth,"0")=0 And Len(bMonth) = 1 THEN

bMonth = "0" & bMonth

END IF

 

bFile = "d" & Year(Date) & bMonth & Day(Date)

fpath = bDrive & ":\Video\" & bFile & "\"

 

Call CreatePath(fpath)

 

Const OverwriteExisting = True

Set objFSO = CreateObject("Scripting.FileSystemObject")

objFSO.CopyFile "d:\" & bFile & "\*.vgz" , fpath, OverwriteExisting

 

Sub CreatePath(sPath)

Dim lCt, sFound, l

Dim sTmpPath, lPos, fs, sTmp

Set fs = CreateObject("Scripting.FileSystemObject")

For lCt = 1 To Len(sPath)

If Mid(sPath, lCt, 1) = "\" Then

sFound = sFound & lCt & ";"

End If

Next

For l = 1 To Len(sFound)

If Mid(sFound, l, 1) <> ";" Then

sTmp = sTmp & Mid(sFound, l, 1)

Else

sTmpPath = Left(sPath, CLng(sTmp))

If Not fs.FolderExists(sTmpPath) Then

fs.CreateFolder (sTmpPath)

End If

sTmp = Empty

End If

Next

If Not fs.FolderExists(sPath) Then

fs.CreateFolder (sPath)

End If

Set fs = Nothing

Exit Sub

End Sub

 

'-----------------------------------------------------------------

Share this post


Link to post
Share on other sites

Hi rory,

I'm really appreciate your help....... million thanks... my PC DVR will store the daily video files like the following directory structure. D:\database folder is the main folder and daily it will create "d20050713" under d:\database folder so for todays video file it will be under d:\database\d20050713 and yesterday video files will be under d:\database\d20050712 and tomorrow videos files will be under d:\database\d20050714

 

What i want is a script to copy daily folder d:\database\d20050713(all the files and sub-directory as well) to f:\database folder

 

Please advice. thanks

Share this post


Link to post
Share on other sites

okay ... does it have sub folders also??

 

if so will have to pull out some of my old scripts for that ... though even easier to do in dos ... give til tomorrow and ill get something for you ...

 

If there are no sub directories, then the above script will work ... just need to change the main directory to \database\

Share this post


Link to post
Share on other sites

Hi rory,

 

D:\database\(this is the main folder)

D:\database\d20050713(dyearmonthdate)(this is the daily folders that auto create by the system and there are files & subdirectory under this folders as well)

 

I need to backup the daily files and sub folders under auto created folder d:\database\d20050713

Share this post


Link to post
Share on other sites

Okay this copies the entire folder which includes all sub folders.

What it does is copy to a folder on the archive drive called "Archive" and then the rest of it is the same ... this in case you want to switch the drive to a normal drive like C,D or something else with other numorous folders and files on it, i can change the folder Archive to another name if you want, or you can change it yourself where it says fpath and archive ...

 

try it out ... let me know ..if you want it as an EXE then let me know too, Nortons may block it also due to Nortons built in Script Blocking (from the days of the vbs virus scripts), so let me know ..

 

By the way, it copies the folder as you listed it, the CURRENT date, by using the year, month, and day. I created similar folders on my HDD and sub folders and files and sub folders under sub folders, and above those, etc etc, and it copied them all properly. I used "c" drive for my test.

 

I changed my PCs date and it would copy it if I have a folder for that date, if not it just does nothing .. if you need it to create an error message or anything specific if there is no folder for that day, let me know. I created a folder say for October, and it copied it no problem.

 

So you just have to add it to windows scheduling to run once a day and it will work. I can throw together an EXE for you if you want that will do the same thing but it will do all the schedule set up for you .. if you want ... just not until tomorrow ... same code but in an EXE. ..

 

Didnt spend a whole lot of time on this so it could use some more customizing, cleaning up and all, but it will work for what you need

 

'-----------------------------------------------------------------

 

CONST bDrive = "f"

 

DIM bMonth

DIM bFile

DIM fpath

 

On Error Resume Next

 

bMonth = Month(Date)

IF Instr(1,bMonth,"0")=0 And Len(bMonth) = 1 THEN

bMonth = "0" & bMonth

END IF

 

bFile = "d" & Year(Date) & bMonth & Day(Date)

fpath = bDrive & ":\archive\database\"

 

Call CreatePath(fpath)

 

Const OverwriteExisting = True

Set objFSO = CreateObject("Scripting.FileSystemObject")

objFSO.CopyFolder "d:\database\" & bFile, fpath, OverwriteExisting

 

Sub CreatePath(sPath)

Dim lCt, sFound, l

Dim sTmpPath, lPos, fs, sTmp

Set fs = CreateObject("Scripting.FileSystemObject")

For lCt = 1 To Len(sPath)

If Mid(sPath, lCt, 1) = "\" Then

sFound = sFound & lCt & ";"

End If

Next

For l = 1 To Len(sFound)

If Mid(sFound, l, 1) <> ";" Then

sTmp = sTmp & Mid(sFound, l, 1)

Else

sTmpPath = Left(sPath, CLng(sTmp))

If Not fs.FolderExists(sTmpPath) Then

fs.CreateFolder (sTmpPath)

End If

sTmp = Empty

End If

Next

If Not fs.FolderExists(sPath) Then

fs.CreateFolder (sPath)

End If

Set fs = Nothing

Exit Sub

End Sub

 

'-----------------------------------------------------------------

Share this post


Link to post
Share on other sites

Hi rory,

Thanks... it works perfectly..... as what i want... but if it is possible to backup yesterday data instead of current data.....

Share this post


Link to post
Share on other sites

ohh gawd it keeps coming

 

ill check .. its workable .. just requires some extra code ...

 

Its doable, but will require some special funtions .. can you just run it at 11pm every night ..? If not then I can do it but not until tomorrow night ..

 

Rory

Share this post


Link to post
Share on other sites

hi rory,

any good news about auto backup yesterday files instead of current files... Thanks in advance

Share this post


Link to post
Share on other sites

Hi rory,

Sorry keep disturbing you as I really need someone to advise me the scripts that can backup yesterday video files instead of current day's file. Your reply is much appreciated. Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×