Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Projekt Backup in betch file  (Read 1228 times)

0 Members and 1 Guest are viewing this topic.

shyqyri

    Topic Starter


    Rookie

    • Experience: Beginner
    • OS: Unknown
    Projekt Backup in betch file
    « on: June 13, 2012, 02:29:20 PM »
    Many thanks for the help can you are to give me,
    since made some changes to the betch file code,
    referring to the assistance that you gave me
    I received the response the following message.
    I need to look as Percent from 1% to 100% of material being copied
    by the time can I executed the file.
    Originally if I download a program from internet,and waiting until a 100%.

    thank you very mutch.



    this mesage:

    C:\Documents and Settings\Administrator.IBD\Desktop>set day=13

    C:\Documents and Settings\Administrator.IBD\Desktop>set mnth=06

    C:\Documents and Settings\Administrator.IBD\Desktop>set yr=12

    C:\Documents and Settings\Administrator.IBD\Desktop>if 06 == 01 set mnth=JAN

    C:\Documents and Settings\Administrator.IBD\Desktop>if 06 == 02 set mnth=FEB

    C:\Documents and Settings\Administrator.IBD\Desktop>if 06 == 03 set mnth=MAR

    C:\Documents and Settings\Administrator.IBD\Desktop>if 06 == 04 set mnth=APR

    C:\Documents and Settings\Administrator.IBD\Desktop>if 06 == 05 set mnth=MAY

    C:\Documents and Settings\Administrator.IBD\Desktop>if 06 == 06 set mnth=JUN

    C:\Documents and Settings\Administrator.IBD\Desktop>if JUN == 07 set mnth=JUL

    C:\Documents and Settings\Administrator.IBD\Desktop>if JUN == 08 set mnth=AUG

    C:\Documents and Settings\Administrator.IBD\Desktop>if JUN == 09 set mnth=SEP

    C:\Documents and Settings\Administrator.IBD\Desktop>if JUN == 10 set mnth=OCT

    C:\Documents and Settings\Administrator.IBD\Desktop>if JUN == 11 set mnth=NOV

    C:\Documents and Settings\Administrator.IBD\Desktop>if JUN == 12 set mnth=DEC

    C:\Documents and Settings\Administrator.IBD\Desktop>set dte=13JUN12
    Start Time = 22:00:05.09
            1 file(s) copied.
    sleep
    'sleep' is not recognized as an internal or external command,
    operable program or batch file.
    Stop Time =  22:10:38.60
    Total Run Time = 633  seconds
    -------------------------------------------------------

    this changes to the betch file code,



    set day=%date:~-10,2%
    set mnth=%date:~-7,2%
    set yr=%date:~-2,2%
    if %mnth%==01 set mnth=JAN
    if %mnth%==02 set mnth=FEB
    if %mnth%==03 set mnth=MAR
    if %mnth%==04 set mnth=APR
    if %mnth%==05 set mnth=MAY
    if %mnth%==06 set mnth=JUN
    if %mnth%==07 set mnth=JUL
    if %mnth%==08 set mnth=AUG
    if %mnth%==09 set mnth=SEP
    if %mnth%==10 set mnth=OCT
    if %mnth%==11 set mnth=NOV
    if %mnth%==12 set mnth=DEC
    set dte=%day%%mnth%%yr%

    @echo off
    echo Start Time = %TIME%
    set /a HH=0
    set /a MM=0
    set /a SS=0
    set /a HM=0
    set /a MS=0
    set /a HS=0
    set /a SA=0
    set HH1=%TIME:~0,2%
    set MM1=%TIME:~3,2%
    set SS1=%TIME:~6,2%



    copy "\\192.168.2.211\f\AutoBackup DSMS\DSMS_BCK.bak" "C:\Documents and Settings\Administrator\Desktop\test\DSMS"\%dte%DSMS_Backup.bak /y
    copy "\\192.168.2.211\f\AutoBackup DSMS\Dsms_Exchange.bak" "C:\Documents and Settings\Administrator\Desktop\test\DSMS_Exchange"\%dte%DSMS_Exchange.bak /y



    echo sleep %1
    sleep  %1
    echo Stop Time =  %TIME%
    set SS2=%TIME:~6,2%
    set HH2=%TIME:~0,2%
    set MM2=%TIME:~3,2%
    set /a HH=%HH2%-%HH1%
    set /a MM=%MM2%-%MM1%
    set /a SS=%SS2%-%SS1%
    if %HH%==0 goto alt
    if %MM%==0 goto alt1
    set /a HM=%HH%*60
    set /a MS=%MM%*60
    set /a HS=%HM%*60
    set /a SA=%HS%+%MS%+%SS%
    echo Total Run Time = %SA% seconds
    goto end

    :alt
    if %MM%==0 goto alt1
    set /a MS=%MM%*60
    set /a SA=%MS%+%SS%
    echo Total Run Time = %SA%  seconds
    goto end

    :alt1
    set /a SA=%SS%
    echo total time: %SA%

    :end

    echo MSGBOX "Backup of DSMS Databasse have been save sucesfull, Thank You! *Shyqyri Hysesani*." > %temp%\TEMPmessage.vbs
    call %temp%\TEMPmessage.vbs
    del %temp%\TEMPmessage.vbs /f /q




    Allan

    • Moderator

    • Mastermind
    • Thanked: 959
      • Forum Administrator
    • Experience: Guru
    • OS: Windows 7
    Re: Projekt Backup in betch file
    « Reply #1 on: June 13, 2012, 03:43:13 PM »
    I deleted your other posts. Please stop posting the same question all over the forum - one post per question is all you need. Also, please do not post your question in other people's threads. Thank you.

    shyqyri

      Topic Starter


      Rookie

      • Experience: Beginner
      • OS: Unknown
      Re: Projekt Backup in betch file
      « Reply #2 on: June 13, 2012, 04:09:41 PM »
      ok,

      Lemonilla



        Intermediate
      • "Too sweet"
      • Thanked: 13
        • Computer: Specs
        • Experience: Familiar
        • OS: Windows 7
        Re: Projekt Backup in betch file
        « Reply #3 on: June 13, 2012, 04:34:45 PM »
        1. Do you have sleep installed on your computer? that would be the first question I would ask as it says that It doesn't recognize the command.
        2. what is %1 in 'sleep %1'?
        3. what OS are you using?

        shyqyri

          Topic Starter


          Rookie

          • Experience: Beginner
          • OS: Unknown
          Re: Projekt Backup in betch file
          « Reply #4 on: June 14, 2012, 06:23:03 AM »
          1)-I use Win XP and Win Server 2003

          2)-i wont to create one project in Betch File, can copy this data: Backup.BAK from sorce //192.168.2.211/f/AutoBackup/ to onather server to this destinacione, for example: //192.168.2.10/d/ManualBackup

          3)-I need to look as Percent from 1% to 100% of material being copied
          by the time can I executed the file.
          Originally if I download a program from internet,and waiting until a 100%.

          Thenk you
          Best Regards
          Eng Shyqyri Hysesani

          Squashman



            Apprentice
          • Thanked: 44
            • Experience: Experienced
            • OS: Other
            Re: Projekt Backup in betch file
            « Reply #5 on: June 14, 2012, 07:43:13 AM »
            Batch really can't do an accurate progress bar or tell you how long it is going to take to process something.

            You may want to look at ROBOCOPY as it has these two switches:
            Code: [Select]
            /NP :: No Progress - don't display % copied.
            /ETA :: show Estimated Time of Arrival of copied files.

            shyqyri

              Topic Starter


              Rookie

              • Experience: Beginner
              • OS: Unknown
              Re: Projekt Backup in betch file
              « Reply #6 on: June 16, 2012, 02:02:15 AM »
              there is any application that when executed to copy the starget path and past in destinacion path, and show me the time of remaining proces ore percent of copy.
              thanks

              shyqyri

                Topic Starter


                Rookie

                • Experience: Beginner
                • OS: Unknown
                Re: Projekt Backup in betch file
                « Reply #7 on: June 16, 2012, 04:02:53 AM »
                is through the sql's jobs, how can we realize??

                Lemonilla



                  Intermediate
                • "Too sweet"
                • Thanked: 13
                  • Computer: Specs
                  • Experience: Familiar
                  • OS: Windows 7
                  Re: Projekt Backup in betch file
                  « Reply #8 on: June 16, 2012, 09:20:51 AM »
                  I don't know if this will help,  but have have an output of "56%" you would "echo 56%%%" or echo %progress%%%%"

                  shyqyri

                    Topic Starter


                    Rookie

                    • Experience: Beginner
                    • OS: Unknown
                    Re: Projekt Backup in betch file
                    « Reply #9 on: June 16, 2012, 09:31:24 AM »
                    the second,

                    Salmon Trout



                      Sage

                      Thanked: 645
                      • Yes
                    • Computer: Specs
                    • Experience: Experienced
                    • OS: Windows 7
                    Re: Projekt Backup in betch file
                    « Reply #10 on: June 16, 2012, 11:16:33 AM »
                    there is any application that when executed to copy the starget path and past in destinacion path, and show me the time of remaining proces ore percent of copy.
                    thanks

                    I use TeraCopy - it's free (for non-commercial use) and can be run from the command line. There are other similar apps, such as SuperCopier.







                    Although I agree that Microsoft's own Robocopy is very good. It is a console program which shows percentage progress.










                    « Last Edit: June 16, 2012, 11:40:11 AM by Salmon Trout »

                    Proud to be European

                    shyqyri

                      Topic Starter


                      Rookie

                      • Experience: Beginner
                      • OS: Unknown
                      Re: Projekt Backup in betch file
                      « Reply #11 on: June 16, 2012, 02:58:59 PM »
                      hahahaha, thenks but don't me undestand.
                      i wont to copy some shared backup files (name.BAK), per example 4 shared files in this server://server1/backup/dsms.bak, //server2/backup/exchange.bak, //server3/backup/nav.bak, //server4/backup/domain.bak, to one server per example, //backup-server/DataBackup/2012/     
                      for one click on betch file aplications ore create jobs in sql can copy this shared file from server 1,2,3 to //backup-server/DataBackup/2012/
                      Terra Copy, Super Copy2 ect don't work for my Plane-Project.
                      thank  you
                      best regards
                      Shyqyri Hysesani