Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 627
  • Last Modified:

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

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
rjackmanwyn
Asked:
rjackmanwyn
  • 2
  • 2
1 Solution
 
knightEknightCommented:
What is the exact filename?  Does it contain today's date?
0
 
knightEknightCommented:
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
 
rjackmanwynAuthor Commented:
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
 
rjackmanwynAuthor Commented:
Thank You. With your help I figured it out.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now