Solved

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

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

808 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