cmd-Script for 7z

Help
2005-02-09
2012-12-07
  • Nobody/Anonymous

    hello I have made a script to make a copy of a specific folder:

    @echo off

    set LOG="J:\Backups\Logfile %Date%.txt"
    set RUN7="C:\Programme\7-Zip\7z.exe"

    echo Backup vom: %Date%, %Time% >> %LOG%
    echo shop.7z wird aktualisiert >>%LOG%

    %RUN7% u "J:\Backups\shop.7z" "D:\apachefriends\xampp\htdocs\shop" >>%LOG%

    7z dont write to my logfile in J:\Backups\Logfile %Date%.txt, why?

     
    • PatLogan

      PatLogan - 2005-02-09

      It's an interesting question, I had the same but didn't take the time to ask...

       
    • Ares

      Ares - 2005-02-09

      http://sourceforge.net/forum/message.php?msg_id=2808502

      That might help, I personally haven't tried.

      -Ares

       
    • Nobody/Anonymous

      it works, but it remove my lines (echo shop.7z wird aktualisiert >>%LOG%)

       
      • PatLogan

        PatLogan - 2005-02-09

        you must put >> and not > to append the file
        Pat

         
    • Nobody/Anonymous

      thx

       
    • Stepho

      Stepho - 2005-02-09

      7-Zip writes all it's output (info and error) to the standard error output (stderr), so you should use 2>>%LOG%

      This is because 7-Zip can compress from standard input and extract to standard output (the -si and -so command line parameters). So to avoid problems, all the informative output is done to the standard error output (stderr)

       

Log in to post a comment.