Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

bat file that copies files from production to dev

hello,

i've created a batch file that copies qvds from production to dev.

the problem is i want the batch to only copy the qvds that were created in the last day, not all the files ever.

this is how the code is written now:

copy "D:\QlikView\Models\PerformanceModel\DB\QvdDaily\*.qvd" "D:\QlikView\Dev\PerformanceModel\DB\QvdDaily"

how do i limit the code to copy only the files created in the last day, or even the last week?

thanks,

Yaron.

2 Replies
Miguel_Angel_Baeyens

Hi Yaron,

Use xcopy instead (which comes with Windows) to copy files depending on their modify/create date.

Use a variable to populate the date in Windows format then use xcopy

LET vDateCopy = Date(Today(), 'MM-DD-YYYY');

EXEC xcopy "D:\QlikView\Models\PerformanceModel\DB\QvdDaily\*.qvd" "D:\QlikView\Dev\PerformanceModel\DB\QvdDaily" /d:'$(vDateCopy)'

Miguel

maxgro
MVP
MVP

just some idea

xcopy has an interesting parameter:

/d[:mm-dd-yyyy] : Copies source files changed on or after the specified date only. If you do not include a mm-dd-yyyy value, xcopy copies all Sourcefiles that are newer than existing Destination files. This command-line option allows you to update files that have changed.


you can use QlikView to create and run a bat file

http://community.qlik.com/message/493224#493224