Re: Bat. files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Re: Bat. files

    I know this isnt a dmis question but anyway....

    I am running a batch file to do backup's to an external hard drive once a day.
    I am using xcopy c:\home\*.* E:\NEW\*.*/y/e

    when it saves it overwrites the files it copied last time! Does anyone know how can index these? Either by date or autonumber?

  • #2
    You would have to save to a new folder or virtual drive...

    Create a new folder based on the date of the backup and then XCOPY into that folder.
    Links to my utilities for PCDMIS

    Comment


    • #3
      Add a rename dir and a make dir to the batch
      sigpic
      if you had soap on a rope it would be tied to yer ankle

      Comment


      • #4
        I have tried the mkdir but it overides the previous directyr

        How can i have a new directory name each tim?

        Comment


        • #5
          if i rename then mkdir it will replace the last one every time....

          Comment


          • #6
            This is how i'm doing it....
            Created 30 Folders labeled mostrecent,1dayago,2dayago,3dayago,etc. up to 30dayago. Each time the.bat is executed it deletes the files in 30dayago then moves 29dayago into 30dayago and so on...Then xcopy todays backup into the mostrecent This way i always have a months worth of data & programs backed up....Not really familiar with dos cmds but i guess this will work...

            Comment


            • #7
              Write an integer in a file xxxxx-xx revx
              read an integer in that file thats keeping track everytime the program is executed past that point, then put a variable in that reads (V+1) so it updates.

              get the idea?




              G

              or have you looked at your
              http://sp1.mm-a6.yimg.com/image/3518152100


              G
              sigpic

              Comment


              • #8
                Here is a VBScript file that will do a backup to a folder that is named for todays date. It runs just like a BAT file but uses vb.net language. Place it in the folder of your choice and you can set it up on Windows scheduler to run at night.

                Open the file like you would a BAT file(use NOTEPAD) and edit the paths for the folders of the source files and the destination folder. The backup folder created will be inside the specified folder. Save the file.

                Try a test folder and see how it runs before setting up for your files. To test it, make the path changes, save the file, then double-click on the file and the script will run.


                RIGHT CLICK-SAVE LINK AS

                Just like BATCH files, your Anti-virus software may not like the Script file.
                Links to my utilities for PCDMIS

                Comment

                Related Topics

                Collapse

                Working...
                X