Batch file to copy

Soul Glo

Soul Glo

VIP Member
I need to know if anyone can advise on a way to copy pdf's from the print queue location to another file server based on the date/time created. I need to do this for a particular report on a daily basis but I need to make sure that I pick up all the reports.

I was thinking of a batch file that will do a compare on date time before it does the copy.

Any advice or assistance will be appreciated.
 
You will have a difficult time comparing dates & times with a batch file. Use Perl if you are familiar with it.
 
[ QUOTE ]
Not familar on how to write Perl

[/ QUOTE ]

Regardless of what other language/tool you use, I just wanted to recommend staying away from batch files if you are doing anything remotely complex; especially something like comparing dates or strings. Check out www.cpan.org or www.perlmonks.org for more information. Maybe someone else on the list has a better suggestion that would require less overhead than installing Perl and learning a new language....? :)
 
Since you only need a certain report you could use a batch file to copy for example R09801* to the other share. You can then use WINDOWS SCHEDULER to run the batch file every hour if needed. If the files exist on the other share it should just error out (you will need to test this) on those files that were copied previously.

A couple of tips.

Do not move the report as the pointer in Peoplesoft will be orphaned.

Make sure that the WINDOWS user account used to run the scheduled job has access to the share on the other server.

As mentioned on a previous post using PERL to select by date and time is best but you need to know the language.
 
Here's a little tool I wrote attached here - it can be used in Windows batch scripts to compare dates (provided that you are familiar with the batch scripting enough to do the rest).

Basically, it accepts 3 params - two dates and a comparison operator and sets %ERRORLEVEL% to 1 if the condition evaluates to TRUE.

Saved me a lot of headache...
 

Attachments

  • 87260-CompareDate.zip
    188 KB · Views: 108
Can you read the server map records pulling the PDF file names you need and pass them as an argument to a batch file?
 
Theres a program in NT resource kit called ROBOCOPY.EXE. It has more options than you could imagine for copying files around and should do what you want without any difficulties.

Barry
 
Back
Top