Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File copy and only newer and log actions

Status
Not open for further replies.

uvwaves

MIS
Jan 19, 2004
3
US
Hello All,
I have a manual update file in batch format now that copys source files from a server share to local workstation and only copies newer files to the local machine program directory

I have a locally developed app that we push quarterly updates out for and along with the normal 'bigfix' software update push, there is a manual update batch file that we have users initiate when the normal distribution tool is not fast enough for them.

What I am asking:
Create this manual update function, copy if newer in vbscript
additional enhancements:
I would also like to add the function to delete any files that exist on the local machine program file location if not exist on server share location. The reason being, there has been no cleanup on local workstation program files and they are typically in the environment for a 3 year period. The local machines sometimes have un-needed files in the program directory. I have the source directory with only the currently relevant files for that application.

I would like a log file written to a server, each time the manual file is run, will write the following information in the format shown on seperate line:
computername, username, date(mm/dd/yyyy), time(hh:mm:ss), number of files copied to local workstation, number of files deleted.
 
Do you have any code yet?

1) clean program directory.
a) get a list of files from the server program directory
b) get a list of files from the local machine program directoy
c) traverse the local machine file list and remove any file that is not on the server file list.

2) copy newer files from server to local machine.
a) traverse the server file list and compare the modified date to the local machine's file modified date. If more recent, then copy otherwise, next.


-Geates


"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom

"I do not offer answers, only considerations."
- Geates's Disclaimer
 
>Create this manual update function, copy if newer in vbscript

You might want to look at Microsoft's Robocopy tool, which can do all of what you are asking
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top