Menu

7-Zip Command line help

M.Shoari
2008-01-04
2012-12-08
  • M.Shoari

    M.Shoari - 2008-01-04

    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.

     
    • SeldomGood

      SeldomGood - 2008-01-04

      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?

       
    • M.Shoari

      M.Shoari - 2008-01-07

      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.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.