Hello,
I have two PC in a domain (Computer-A & Computer-B).
Computer-A generates backup files (everyday) with a date/time stamp for that day:
D:\DatabasesBK\Daily\MinsampGahchoKue_BACKUP_200801010001.BAK
\MinsampGahchoKue_BACKUP_200801020001.BAK
\MinsampGahchoKue_BACKUP_200801030001.BAK
I like to write a .BAT file to perform these tasks in sequence and by running the .BAT file on computer-B, I like to accomplish the following tasks everyday.
1. select the latest (e.g. MinsampGahchoKue_BACKUP_200801030001.BAK) file in the “D:\Databases\Daily” directory and 7-Zip it and place it in the same directory.
2. copy the .7z file across to a specific directory on computer-B
3. extract the file in the .7z on computer-B
4. delete the .7z file on computer-A
5. delete the .7z file on computer-B
I have been able to configure how to run this .BAT file on computer-B and map the paths etc in the domain/network to perform all above tasks, but have difficulty to command line No 1 and 3.
Any help would be greatly appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am not sure if I understand copòetely; you are running a script on Computer-B and the d:\DatabasesBK\Daily\MinsampGahchoKue_BACKUP_200801010001.BAK file is on Computer-A?
and are you mounting d:\DatabasesBK\Daily\ as a network drive on Computer-B?
If so, Computer-B is doing the compression and MinsampGahchoKue_BACKUP_200801010001.BAK is transferred to Computer-B via network, compressed and the result is transferred back to Computer-A via network. Then you transfer the archive to Computer-B again, extract it and delete archive from both Computers.
If I am correct you are wasting bandwidth (if I am not, well... forget me): you would be better off if Computer-A were to do the compression as part of the backup process (assuming it is accomplilshed via a script),
cd /D d:\DatabasesBK\Daily\
7z a MinsampGahchoKue_BACKUP_200801010001.7z MinsampGahchoKue_BACKUP_200801010001.BAK
the Computer-B could just extract the archive like ( assuming you mounted d:\DatabasesBK\Daily\ as drive Z:)
7z e -oc:\whatever\dir\you\like\ z:\MinsampGahchoKue_BACKUP_200801010001.7z
del z:\MinsampGahchoKue_BACKUP_200801010001.7z
Did I undertand and therefore was useful to you?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Many thanks for the note and instructions/guidance. I think i had mis-explained the problem a little bit. The way you described is exactly what is happening with network drive mounting etc. I will put this in action with the remote machines and i am sure that they will work no problem. May thanks again - much appreciated. Regards, M.Shoari, Toronto, Canada.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I have two PC in a domain (Computer-A & Computer-B).
Computer-A generates backup files (everyday) with a date/time stamp for that day:
D:\DatabasesBK\Daily\MinsampGahchoKue_BACKUP_200801010001.BAK
\MinsampGahchoKue_BACKUP_200801020001.BAK
\MinsampGahchoKue_BACKUP_200801030001.BAK
I like to write a .BAT file to perform these tasks in sequence and by running the .BAT file on computer-B, I like to accomplish the following tasks everyday.
1. select the latest (e.g. MinsampGahchoKue_BACKUP_200801030001.BAK) file in the “D:\Databases\Daily” directory and 7-Zip it and place it in the same directory.
2. copy the .7z file across to a specific directory on computer-B
3. extract the file in the .7z on computer-B
4. delete the .7z file on computer-A
5. delete the .7z file on computer-B
I have been able to configure how to run this .BAT file on computer-B and map the paths etc in the domain/network to perform all above tasks, but have difficulty to command line No 1 and 3.
Any help would be greatly appreciated.
I am not sure if I understand copòetely; you are running a script on Computer-B and the d:\DatabasesBK\Daily\MinsampGahchoKue_BACKUP_200801010001.BAK file is on Computer-A?
and are you mounting d:\DatabasesBK\Daily\ as a network drive on Computer-B?
If so, Computer-B is doing the compression and MinsampGahchoKue_BACKUP_200801010001.BAK is transferred to Computer-B via network, compressed and the result is transferred back to Computer-A via network. Then you transfer the archive to Computer-B again, extract it and delete archive from both Computers.
If I am correct you are wasting bandwidth (if I am not, well... forget me): you would be better off if Computer-A were to do the compression as part of the backup process (assuming it is accomplilshed via a script),
cd /D d:\DatabasesBK\Daily\ 7z a MinsampGahchoKue_BACKUP_200801010001.7z MinsampGahchoKue_BACKUP_200801010001.BAK
the Computer-B could just extract the archive like ( assuming you mounted d:\DatabasesBK\Daily\ as drive Z:)
7z e -oc:\whatever\dir\you\like\ z:\MinsampGahchoKue_BACKUP_200801010001.7z
del z:\MinsampGahchoKue_BACKUP_200801010001.7z
Did I undertand and therefore was useful to you?
Many thanks for the note and instructions/guidance. I think i had mis-explained the problem a little bit. The way you described is exactly what is happening with network drive mounting etc. I will put this in action with the remote machines and i am sure that they will work no problem. May thanks again - much appreciated. Regards, M.Shoari, Toronto, Canada.