Urgent :Batch file for rename and copy the log file
Posted on 2007-10-01
I have a log file called "hr_xms_interface_vb.log" in D:\hr_xms_prog.
I have batch file which runs every day and gives me this log file (hr_xms_interface_vb.log).
That part works fine.
But now i want to copy this log file to D:\hr_xms_prog\hr_xms_interface_log_backup folder.
and to rename it as hr_xms_interface_vb_001.log(For back up purpose). Next time when i run the batch file, i want the latest log file as hr_xms_interface_vb_001.log and the previous log file as(old log file) hr_xms_interface_vb_002.log. and so on.
I have to keep 5 days log file as back up. So in 6 th time,hr_xms_interface_vb_005.log has to be deleted and all others to be renamed correspondingly.
Could you please help me to write a batch file for doing this?
Thanks in Advance.