Re: Scripting: Zipping files and checking Network Share



Zipping:
http://www.rondebruin.nl/windowsxpzip.htm

Tim

"Chris" <Chris@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:618687AA-5EF6-4E7D-BDFD-1089131CD70A@xxxxxxxxxxxxxxxx
Community,

First off, have done some VB.Net programming - but am in No way an expert.
I
probably forgot 80% of it since i do not use it often.

I am trying to write a script (fun so far!) that performs a few specific
tasks. I'm looking for some pointers, reference sites that can help me
with
the following items:
Task 1
Copy source files to destination only if they do not exsist on the
destination drive.
(completed)

Task 2
create a zip file in MMM-YYYY.zip, check date of file (prob. created date)
and move the file to the archive. However, I do not want to copy files
created the same day the script is running. So, if Nov-2008.zip was
created
- all files for the month of November get moved into the archive. This
script
will run several times a day.

Task 3
The script is going to be running on the destination machine. Using
network
shares, but do not want to map a drive. I want the script to check for
connectivity to the source drive. Once I have this - I think I can figure
out how to have it loop until a successful connection is made - and send
out
e-mail alerts if unable to establish a connection after x many tries or
some
sort of counter value.


Here is what I have thus far:

' Purpose:
' Check Source and Destination. If source has a file that destination
does
not, copy source to destination. One-way Sync
' In Source: Create a zip container for the current month/year (MMM-YYYY)
and move files made in that time frame
' to that zip container - do not include files generated on the same day
the script is running.
' Require Error checking (first for network connectivity, than file
copying) Notify by e-mail on all errors and continue loop until network
' connection is made.
'
' Duration: Script to run Hourly, Monday through Friday
'
Dim objFilesys,Folder,objMessage,srcFolder,dstFolder,srcFile,objShell

srcFolder ="\\wrkstation-ip\Greefa_Data\"
dstFolder ="\\server-ip\common\Intake and Processing
Division\Pre-Sort\Greefa_Data\"

Set objFilesys = CreateObject("Scripting.FileSystemObject")
Set objShell = Wscript.CreateObject("Wscript.Shell")

CopySource()

WScript.Quit

'Copies the Source to Destination, minor error checking
Sub CopySource()
For Each srcFile in objFilesys.GetFolder(srcFolder).Files
If Not objFilesys.FileExists(dstFolder &
objFilesys.GetFilename(srcFile)) Then
objFilesys.GetFile(srcFile).Copy dstFolder &
objFilesys.GetFilename(srcFile),False
Else
Msgbox(srcFile & " File Exists")
End If
Next
End Sub

Sub MonthlyZip()
objShell.Exec(...)
' Thinking of using 7zip if I cannot figure out how to use native Win2k3
zip
End Sub


Any suggestions?


.



Relevant Pages

  • problem connecting pipes in Expect.pm
    ... Here is a script I'm working on to connect to various lpars ... lpar, but then the script does not connect the user's stdin ... sub findlpar { ... # wait for connection prompt ...
    (comp.lang.perl.misc)
  • problem connecting pipes in Expect.pm
    ... Here is a script I'm working on to connect to various lpars ... lpar, but then the script does not connect the user's stdin ... sub findlpar { ... # wait for connection prompt ...
    (comp.lang.perl.modules)
  • Scripting: Zipping files and checking Network Share
    ... I am trying to write a script that performs a few specific ... Copy source files to destination only if they do not exsist on the ... out how to have it loop until a successful connection is made - and send out ... Sub CopySource() ...
    (microsoft.public.scripting.vbscript)
  • Re: Macro Message box doesnt display output?
    ... Thanks alot Jim, that's worked a treat. ... > Sub Button5_Click ... > 'WScript.echo "No connection available" ... > I have a script which is linked as a macro to a button on a worksheet. ...
    (microsoft.public.excel.programming)
  • Re: dialup solution (as seconary connection / iptables )
    ... ip-down is launched by pppd only after the PPP link no longer available ... first with MINICOM or is PAP and script not mutualy exclusive? ... do have to "make the connection first with MINICOM." ... If you use the Linux box and route the news IP address to it on each ...
    (comp.os.linux.networking)

Loading