- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Microsoft
- >
- Re: Monthly Backups....dos style =)
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2004 09:26 AM
тАО07-14-2004 09:26 AM
Re: Monthly Backups....dos style =)
Sorry i was tied up in a work and not able to post the script faster...
Here it is now..
copy the below code to some filename.wsf for ex., c:\copyfiles.wsf
<script language="VBScript">
dim FSO
dim objsourcefolder
dim filecollection
dim filepath
dim oWS
dim Lastmonth
dim returncode
dim scmd
folder_path="h:\"
Set FSO = CreateObject("Scripting.FileSystemObject")
set oWS = CreateObject("Wscript.Shell")
Set objSourceFolder = FSO.GetFolder(folder_path)
Set fileCollection = objSourceFolder.files
For Each filePath in fileCollection
Lastmonth = CInt(DateDiff("m",filePath.DateLastModified,Now))
scmd = "c:\Program Files\Winzip\wzzip c:\backup\Daily\h" & month(now) & day(now) & year(now) & ".zip -r -p -t "
If Lastmonth = 1 Then
scmd = scmd & folder_path & filepath.name
'WScript.Echo scmd
returnCode = oWS.Run(scmd, 0, true)
End If
next
dim subfolderscoll
dim subfol
set subfolderscoll = objsourcefolder.subfolders
for each subfol in subfolderscoll
Set fileCollection = subfol.files
For Each filePath in fileCollection
Lastmonth = CInt(DateDiff("m",filePath.DateLastModified,Now))
scmd = "c:\Program Files\Winzip\wzzip c:\backup\Daily\h" & month(now) & day(now) & year(now) & ".zip -r -p -t "
If Lastmonth = 1 Then
scmd = scmd & folder_path & subfol.name & "\" & filepath.name
' WScript.Echo scmd
returnCode = oWS.Run(scmd, 0, true)
End If
next
next
</script>
run this script as
CScript.exe C:\copyfiles.wsf
Let me know how it goes..
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2004 09:36 AM
тАО07-14-2004 09:36 AM
Re: Monthly Backups....dos style =)
Thanks again for all your work you guys =)
Totally appreciated!
Monty.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2004 09:55 AM
тАО07-14-2004 09:55 AM
Re: Monthly Backups....dos style =)
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\lovell.HMFH>Cscript.exe c:\backup\sys\copyfiles.wsf
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
c:\backup\sys\copyfiles.wsf(31, 2) (null): The system cannot find the file speci
fied.
Hi Ganesh. I just tried it, maybe I gave you the wrong information...or I tried to run it incorrectly. I copied this from the DOS window. Does the script file look for all files within the H: drive or is it looking through the already made daily zip files?
I will totally understand if you just want to drop this...sorry for this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2004 02:32 AM
тАО07-15-2004 02:32 AM
Re: Monthly Backups....dos style =)
I think the issue is the system did not take the long folder name..
change this statement in the file
scmd = "c:\Program files\Winzip\wzzip c:\backup\Daily\h" & month(now) & day(now) & year(now) & ".zip -r -p -t "
to
scmd = "c:\Progra~1\Winzip\wzzip.exe c:\backup\Daily\h" & month(now) & day(now) & year(now) & ".zip -r -p -t "
this statement is there 2 times.. so make sure u replace it in both the placess..
Test it out and let me if it works..
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2004 07:14 AM
тАО07-15-2004 07:14 AM
Re: Monthly Backups....dos style =)
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\lovell.HMFH>CScript.exe c:\backup\sys\copyfile.wsf
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
c:\backup\sys\copyfile.wsf(31, 2) (null): The system cannot find the file specif
ied.
Hi Ganesh - I changed it to "~1" both places and it gave me this again. Do you think I'm giving you some wrong data, variables, etc.? Again, if you want to cut your losses I will more than understand. Thanks for all your time in this.
Monty =)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2004 09:40 AM
тАО07-15-2004 09:40 AM
Re: Monthly Backups....dos style =)
The issue is here only
scmd = "c:\Progra~1\Winzip\wzzip.exe c:\backup\Daily\h" & month(now) & day(now) & year(now) & ".zip -r -p -t "
either the wzzip.exe directory is wrong or the path where it is going to create the zip file might be wrong
1) what is the path of wzzip.exe?
2) does c:\backup\Daily\ directory exists??
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2004 09:48 AM
тАО07-15-2004 09:48 AM
Re: Monthly Backups....dos style =)
I'm hoping to write a zip file that searches all files on H: drive.
Hope I didn't throw a wrench in the gears.
Monty =)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2004 10:43 AM
тАО07-15-2004 10:43 AM
Re: Monthly Backups....dos style =)
i want u to run this script
job debug="true">
<script language="VBScript">
dim FSO
dim objsourcefolder
dim filecollection
dim filepath
dim oWS
dim Lastmonth
dim returncode
dim scmd
folder_path="h:\"
Set FSO = CreateObject("Scripting.FileSystemObject")
set oWS = CreateObject("Wscript.Shell")
Set objSourceFolder = FSO.GetFolder(folder_path)
Set fileCollection = objSourceFolder.files
For Each filePath in fileCollection
Lastmonth = CInt(DateDiff("m",filePath.DateLastModified,Now))
scmd = "c:\Progra~1\Winzip\wzzip c:\backup\Daily\h" & month(now) & day(now) & year(now) & ".zip -r -p -t "
If Lastmonth = 1 Then
scmd = scmd & folder_path & filepath.name
WScript.Echo scmd
'returnCode = oWS.Run(scmd, 0, true)
End If
next
</script>
when it runs it will display a message box with the output of the scmd variable. This is the command which has to run to create the zipfile.
So copy that or note it down and run it from where u running the script. And tell me whether there were any errors. If there are any errors. Let me know..
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-16-2004 03:25 AM
тАО07-16-2004 03:25 AM
Re: Monthly Backups....dos style =)
Monty
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\lovell.HMFH>CScript.exe c:\backup\sys\test.wsf
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.
c:\backup\sys\test.wsf(37, 4) Windows Script Host: The end tag does not have a
corresponding start tag : job
>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-16-2004 03:28 AM
тАО07-16-2004 03:28 AM