Solved

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

Posted on 2009-04-05
4
602 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now