Announcement

Collapse
No announcement yet.

Syncing PST Files

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

  • Syncing PST Files

    I have Outlook on my desktop and laptop. Based on what computer I used last, I run the following command (flipped accordingly based on how I'm copying) and the PST is copied to the other computer.

    load "\\Shawnm-r60\SRM Laptop\SRMDATAPST\" "C:\SRMDATAPST\"
    sync create-empty mirror:left->right

    However, if I select the wrong direction (incorrect script), once its starts the PST file is lost. For example, I selected the incorrect script and I copied over yesterday's PST file and today's PST file was lost. I canceled the script, however, I was too late. My PST file was no longer in the folder.

    Is there anything I can add into the script that will first check if I'm overwriting a newer file with an older file?

    Thanks

    Shawn

  • #2
    You should probably use "sync create-empty update:left->right" instead. That will copy newer & orphans without overwriting any newer files on the target side.
    Zoë P Scooter Software

    Comment


    • #3
      Craig:

      Thanks. So if I use "update" and assuming I'm copying over an older file by mistake, what will happen? Will there be a warning dialog or something logged in the file?

      I use Mirror on all my other commands. Does Update make things equal? For example, assume I copy the correct way and on Computer Left I deleted two files, added three more, and modified five files. When I Update, will the right also have the same two files deleted, the three more added, and five modified?

      What I need is every time I run these commands, left and right should be identical afterwards, but protect from clicking on the incorrect batch so copying the incorrect way.

      Yes, human error, but if possible I want to plan for my mistakes )

      Thanks.

      srm

      Comment


      • #4
        Hello,

        Files can align and be detected as: Equal, Newer, Older, Different, or Orphan. Update logic will only copy Newer and Orphan files, so it would not delete any Orphans on the Destination side.

        A Mirror command does make both sides exactly equal. If you are manually viewing this process, you can use our Folder Sync sessions in the graphical interface instead of batch scripts. Scripts are designed for automated tasks with no user input. The graphical interface's Folder Sync sessions show a large preview pane of which files will be copied, deleted, etc before the Sync is committed.

        Alternatively, you could setup a more complicated script that manually selects any Older, Newer, Different, or Orphan files on the Destination side (files that are going to be removed or overwritten during a mirror), and manually back them up to a third location with a Copy To Folder command first.
        Aaron P Scooter Software

        Comment


        • #5
          Aaron:

          Thank you.

          Shawn

          Comment


          • #6
            No problem. One thing I should add: Folder Sync sessions cannot be loaded in script. Script uses the Folder Compare session as its base. If you would like to 'hop' between script calls and the graphical interface, you'll want to setup a Folder Compare session (which also has Sync Update or Sync Mirror commands, available in the Actions menu -> Synchronize).
            Last edited by Aaron; 17-Jan-2011, 11:14 AM. Reason: or => and
            Aaron P Scooter Software

            Comment


            • #7
              Aaron:

              Thanks. I will follow your guidance.

              I had one other question. Is it possible not to have the PST file be deleted using Mirror if I should cancel (even if you don't hit cancel) after the process started, or is the answer above in your other options?

              Shawn

              Comment


              • #8
                I am unsure what you mean by "if I should cancel even if you don't hit cancel".

                Is there an issue when you mirror PST files due to locking? If so, you can use a file name filter -*.pst to exclude them from the comparison and synchronization.
                Aaron P Scooter Software

                Comment


                • #9
                  Originally posted by srm View Post
                  ...
                  load "\\Shawnm-r60\SRM Laptop\SRMDATAPST\" "C:\SRMDATAPST\"
                  sync create-empty mirror:left->right
                  ...
                  I don't know the contents of SRMDATAPST, but I assume ther are only one or more pst-files and no orphans.

                  In this case you should use only one script with sync update:all.

                  This prevents you from starting the wrong script and BC automatically holds both places in sync (copies new and newer files to the other side).

                  Greetings Lutz

                  Comment


                  • #10
                    Thanks. In my PST folder, there is only one file (a PST file). However, when the script runs, there are three other folders also included in the script that use the mirror command and they probably contain a few thousand folders/files. I limited my question to just the PST folder just to see what options are avaialble.

                    Basically if I do select the wrong script with the mirror command, I do not want older files being copied over. I also want to be able to click the "Cancel" button during the batch and if the script happens to be in the middle of copying the PST file (for example), both PST files are kept in place.

                    I guess does mirror check dates before copying? When files are copied, is the file being copied too deleted when the mirroring starts for that file?

                    People have provided some options that I am looking at implementing if what I'm looking at is not possible. I greatly appreciate the help.

                    Also, is it possible to have the script pause while running? I didn't see a script reference for pausing unless I'm missing it.

                    This script I run manually to copy data from my desktop to my laptop to work at home. This one is not automated since my laptop is not always connected. Other scripts I have automated backup to the network, other drives, etc.

                    Shawn

                    Comment


                    • #11
                      The other folders aren't affected if you change the sync from mirror to update after loading SRMDATAPST.

                      Greetings Lutz

                      Comment


                      • #12
                        In addition to Lutz's comments,

                        It sounds like you need to verify and be able to cancel while manually observing your script. At that point I would recommend using the graphical interface's Folder Sync session type. This would allow you to customize the Sync action to copy and delete files as you wish, but never copy Older files over. This is customized in the Folder Sync's Session Settings, Sync tab. It would also show a preview you can review before committing a sync. You can exclude files manually or by using name filters, and can be cancelled by clicking the cancel button as it progresses.
                        If you are using script to streamline the steps of 1) Load BC3 then 2) Load a saved session: you can use a shortcut setup with the command line to load a saved session, which is documented in our Help file in the Command Line reference section.

                        Script can be setup to perform similar steps, but will only show the log of events and not a preview before attempting the sync. Instead of using Sync commands, you can use the Select command to select only Newer files (or Newer and Different), and copy them manually. You can then select the Orphan files and delete them.

                        Please be sure this is the sync logic you wish to follow since script will not preview actions before committing them and deletions will not always go to the recycle bin. Script actions (and GUI actions) are not Undo-able.

                        ***Please test with already backed up locations or test data while you learn how the script will function.***

                        Scripting does not support loading a saved Folder Sync session, only a save Folder Compare or manually loading a pair of folders.

                        We do not currently support Pausing/Resuming of a transfer. If you reload the session, it will re-compare your files and show which are still different and which are now equal from the previous transfer.
                        Aaron P Scooter Software

                        Comment


                        • #13
                          @Aaron: Most of your explanation I had in mind before posting, but unfortunately I can't explain it in (for me) acceptable time in english.
                          But for now I think it's a more trivial need Shawn has:
                          Synching Laptop/Desktop with two BC3-scripts without overwriting newer PST-file(s).
                          ->
                          @Shawn: Reviewing this thread from your initial post for me it's not clear what you want to do!
                          Do you sync several base folders in sequence (as #15 leads to) or do you load a saved Folder Compare session containing all folders?
                          Perhaps it would be helpful to post or attach your script files (I will support this if I knew your need).

                          Greetings Lutz

                          Comment


                          • #14
                            Thank you all. I greatly appreciate all the guidance.

                            I have copied my script below. I will try to explain better what I do (want to do).

                            Each night I run the script below manually. After this is run, I then have on my laptop the same data on my desktop. I work at home, come back into the office and then run the "Laptop to Desktop" script (not shown below). Its identical except the left is my laptop and the right is my desktop.

                            What this allows me to do is make sure the same work data is on both computers.

                            The scripts work fine. However, as we humans do, I have mistakenly selected for example the "Laptop to Desktop" script when I was supposed to select the "Desktop to Laptop". If I had been working for a few days on my desktop (did not work at home), I'm assuming all my data from two days old (from my laptop) is being copied (mirrored) over the data that is two day later (desktop). Its mirroring from the older data and all the new data is being replaced.

                            If I happened to click Cancel when this is running and its copying over my PST file, my newer PST file is deleted. I can't get is back. I had used my PST file as an example since this is one file and where most of my work is done.

                            Please note the software works fine and I've been using it for years. I just wanted to add something as a check if I accidentally click on the incorrect script.

                            If I understand Mirror correctly, there is no check for dates, etc. it just mirrors the data. Am I understanding correctly?

                            ================

                            SCRIPT

                            #Desktop to Laptop

                            option confirm:yes-to-all

                            filter "outcmd.dat" "VbaProject.OTM"
                            load "C:\Documents and Settings\shawnm\Application Data\Microsoft\Outlook\" "\\Shawnm-r60\SRM Laptop\Documents and Settings\shawnm\Application Data\Microsoft\Outlook\"
                            sync mirror:left->right

                            filter "Excel11.xlb"
                            load "C:\Documents and Settings\ShawnM\Application Data\Microsoft\Excel\" "\\Shawnm-r60\SRM Laptop\Documents and Settings\shawnm\Application Data\Microsoft\Excel\"
                            sync mirror:left->right

                            filter "normal.dot"
                            load "C:\Documents and Settings\ShawnM\Application Data\Microsoft\Templates\" "\\Shawnm-r60\SRM Laptop\Documents and Settings\shawnm\Application Data\Microsoft\Templates\"
                            sync mirror:left->right

                            filter "*.*"

                            load "C:\Documents and Settings\shawnm\Application Data\Microsoft\Signatures\" "\\Shawnm-r60\SRM Laptop\Documents and Settings\shawnm\Application Data\Microsoft\Signatures\"
                            sync create-empty mirror:left->right

                            load "C:\SRM Personal\" "\\Shawnm-r60\SRM Laptop\SRM Personal\"
                            sync create-empty mirror:left->right

                            load "C:\SRMDATA\" "\\Shawnm-r60\SRM Laptop\SRMDATA\"
                            sync create-empty mirror:left->right

                            load "C:\SRMDATA - Subversion" "\\Shawnm-r60\SRM Laptop\SRMDATA - Subversion"
                            sync create-empty mirror:left->right

                            load "C:\SRMDATAPST\" "\\Shawnm-r60\SRM Laptop\SRMDATAPST\"
                            sync create-empty mirror:left->right

                            ================

                            Comment


                            • #15
                              Correct. The Mirror command does not need to check a date. If a file is determined to be Newer, Different, Older, or Orphan it will copy it over. Only files determined to be Equal are left alone.

                              If you remove your option confirm:yes-to-all then you should get a prompt warning you before you overwrite a newer file. With this option present, you are suppressing all warning dialogs and answering Yes to them automatically.
                              Aaron P Scooter Software

                              Comment

                              Working...
                              X