Solved

How to use WinZip Or DOS Batch file to copy file with current date

Posted on 2009-04-05
4
610 Views
Last Modified: 2012-05-06
I am using this WinZip command to zip files to be transferred to a remote back up site.  Does anyone know if I could include a parameter that would only include the current date to that command? I keep 7 days of backups, but I only want to transfer the current day. Thanks In Advance
WinZip Command
wzzip -a backup.zip *.bak
 
xcopy Command
xcopy "\\ComputerName\Directory" "D:\Backups" /D /I /E /Y /C /V /R /Z /K /H

Open in new window

0
Comment
Question by:rjackmanwyn
  • 2
  • 2
4 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 24073790
What is the exact filename?  Does it contain today's date?
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 500 total points
ID: 24073812
for example, if the file is named   2009-04-05.bak,  then you can use this as the filename in the winzip command:

wzzip -a backup.zip  %date:~10,4%-%date:~4,2%-%date:~7,2%.bak
0
 

Author Comment

by:rjackmanwyn
ID: 24073813
The file name varies as there are several back ups in this directory. It does contain words such as [database]backup_20090405[Time].bak with the date as YYYYMMDD and time
0
 

Author Closing Comment

by:rjackmanwyn
ID: 31566855
Thank You. With your help I figured it out.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

823 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question