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

Author Topic: Batch file to make backup of a folder based on time and day of week  (Read 22819 times)

0 Members and 1 Guest are viewing this topic.

bhulku123

    Topic Starter


    Rookie

    Re: Batch file to make backup of a folder based on time and day of week
    « Reply #15 on: December 29, 2008, 04:25:33 PM »
    Thank You Dusty, I tried the script at work and i do not know exactly was the wording of the error was, so sorry for the confusion but the taskkill wpont work because CHeckInn need to exit by pressing Exit on its menu screen so i found a program called Eventcoder and i recorded the mouse movement to click Exit and I added the path in the script to run where the Taskkill command line use to be and it worked perfectly. So i deleted the sleep command lines and the whole script ran perfectly.

    But I will make sure it works as intended and I will post the result tomorrow for you.

    But Thank You again for your kind help.

    bhulku123

      Topic Starter


      Rookie

      Re: Batch file to make backup of a folder based on time and day of week
      « Reply #16 on: December 30, 2008, 05:58:59 PM »
      Hello Dusty, The script worked great it did made and copied all files to correct folder also even at3.58am last night which it recorded to MON_C shift folder.

      Thanks DUsty again. I wanted to add couple things if possible,

      1) If the Batchfile can be run as a startup batch file and if it can repeate doing backup every say 3 hours by itself.

      2) If there can be option showup which says If you are ready to Backup Press Y and Hit ENTER to continue doing Backup or Press X to wait for 5 minutes.
       
      In option 2 if the backup need to be delayed by 5 minutes can it go to end and restart after 5 minutes in case the CheckInn program is being used. In this case the next back still runs on time e.g. 3pm, 6pm, 9pm, 12pm etc.

      Can there be a command added to enlarge fonts and may be color the lines seperately.


      Thanks you.


      Dusty



        Egghead

      • I could if she would, but she won't so I don't.
      • Thanked: 75
      • Experience: Beginner
      • OS: Windows XP
      Re: Batch file to make backup of a folder based on time and day of week
      « Reply #17 on: December 30, 2008, 07:43:05 PM »
      1.  Copy the .bat file to "C:\DOCUMENTS AND SETTINGS\USERNAME\START MENU\PROGRAMS\STARTUP\".  Username is the name of the account which starts on your system, it could be Administrator or some other name.  You may also want to delete the commands you have added to kill Checkinn.exe if it has not already been started.  You don't need me to schedule when the .bat file will run, see the XP Task Scheduler here..

      2.  Will respond later.

      The use of the COLOR command is shown here.. or enter COLOR/? at the command prompt.  The only way I know of increasing/decreasing the font size in Cmd.exe is to R.Click the top bar, select Properties>Font and change the font size in the font size slider.  You'd have to make this setting apply to all output in the Cmd.exe window.



      « Last Edit: December 30, 2008, 11:42:33 PM by Dusty »
      One good deed is worth more than a year of good intentions.

      bhulku123

        Topic Starter


        Rookie

        Re: Batch file to make backup of a folder based on time and day of week
        « Reply #18 on: December 31, 2008, 08:05:46 AM »
        Thank you Dusty,

        I will schedule with Xp Task Scheduler ans report the results.

        Thank you again.

        Dusty



          Egghead

        • I could if she would, but she won't so I don't.
        • Thanked: 75
        • Experience: Beginner
        • OS: Windows XP
        Re: Batch file to make backup of a folder based on time and day of week
        « Reply #19 on: January 01, 2009, 06:43:28 PM »
        Unfortunately  I have been unable to locate a timing feature in batch scripting so all timing must be done using the Task Scheduler in order to do what you want.

        Make the start of the Checkinn.bat file look like this:
        Quote
        @echo off
        cls
        setlocal enabledelayedexpansion


        for /f "delims=*" %%1 in (runit.dat) do (
            set runit=%%1
        )
        if "%runit%"=="No" exit

        echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.
        color 1c
        set/p run=            CAN BACKUP BE RUN NOW? (Y/N)...   

        cls

        if "%run%"=="y" call :start

        if "%run%"=="Y" call :start
         
        exit

        :start

        ::  Checkinn.bat

        and the end of the script to this:
        Quote
        echo No>runit.dat
        exit

        Create the file C:\runit.dat containing just the word "Yes" without the quotes.

        Create the following script and save it as filename.bat:
        Quote
        @echo off
        cls
        echo Yes>runit.dat

        Task scheduling Suggestions.
        ===================
        Schedule the main script to run at the times you want, 3 6 9 and 12 pm (note that according to the specs I extracted from your post, these times to not include any backup in Shift A which I have noted as being 4 am to 2pm daily, please confirm).  Also schedule the script to start 5 mins after the above times.

        This will allow the script to run at the appointed hours and at five mins after those times if backup does not proceed.

        Schedule filename.bat to run at say 3.20 6.20 9.20 and 12.20 pm


         
        One good deed is worth more than a year of good intentions.

        bhulku123

          Topic Starter


          Rookie

          Re: Batch file to make backup of a folder based on time and day of week
          « Reply #20 on: January 07, 2009, 04:17:14 PM »
          Thanks Dusty, The Backup is running good so far except i have not added the last post suggestions yet, I wanted to try it first. I a  wondering is there a way to get out of screensaver when the batch file starts or say play a music file in wma format so that to bring attention of the person working?

          I will add script from your last post tomorrow and let you know how it goes.

          Thanks Again.

          him6182

          • Guest
          Re: Batch file to make backup of a folder based on time and day of week
          « Reply #21 on: September 24, 2009, 04:55:13 AM »
          Hi i m new to batch file can any one plz tell me the batch file making process from begning.
          will appericiate for helping me out.
          regds
          him

          Dusty



            Egghead

          • I could if she would, but she won't so I don't.
          • Thanked: 75
          • Experience: Beginner
          • OS: Windows XP
          Re: Batch file to make backup of a folder based on time and day of week
          « Reply #22 on: September 25, 2009, 02:17:10 AM »
          Him6182 - Welcome to the CH forums.

          Please do NOT hijack another member's thread, start your own.

          Batch scripting info can be found here and there a many many on-line tutorials.

          Good luck
          One good deed is worth more than a year of good intentions.