Announcement

Collapse
No announcement yet.

COPYTO or MOVE

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

  • COPYTO or MOVE

    I've started a new post, but this came from
    http://www.scootersoftware.com/ubbth...t=&Number=2939

    I've tried several varieties of scripts that produce what I want in a Folder report, immediately followed by a COPYTO command, but the files in the COPYTO either A) Are different than the report or B) There are no files copied.

    Here's one of my scripts:
    LOAD D:\Production\wwwroot D:\Dev\wwwroot
    EXPAND ALL
    FILTER "*.bak"
    SELECT ALL
    FOLDER-REPORT LAYOUT:Summary &
    OUTPUT-TO:"MoveBAKFiles.htm" &
    OUTPUT-OPTIONS:html-mono
    COPYTO LEFT D:\Temp

    Another is:
    LOAD D:\Production\wwwroot
    EXPAND ALL
    FILTER "*.bak"
    SELECT ALL
    FOLDER-REPORT LAYOUT:Summary &
    OUTPUT-TO:"MoveBAKFiles.htm" &
    OUTPUT-OPTIONS:html-mono
    COPYTO LEFT D:\Temp

    D:\Production\wwwroot has 18,000 files in it under many folders.
    The COPYTO command is trying to copy 6,452 files, while the report only shows the handful of .bak files that I would like to have copied.

  • #2
    Re: COPYTO or MOVE

    I tried your scripts on my system and they seemed to work, but it might help to try changing the select all command to select all.files.

    If you select a folder, an operation (delete, copy, etc), will affect the entire contents of the folder regardless of filters. Filters such as *.bak, only affect which files are visible. Using all.files should limit it to only files that are visible according to the display filter.
    Chris K Scooter Software

    Comment


    • #3
      Re: COPYTO or MOVE

      This works!
      Create a folder called C:\Archive\Temp and then do the following:

      Option confirm:yes-to-all
      LOAD C:\inetpub\wwwroot C:\Archive\Temp
      FILTER "*.bak"
      EXPAND ALL
      SELECT LEFT.FILES
      # The next command maintains the directory structure
      COPY LEFT->RIGHT
      LOAD C:\Archive\Temp
      EXPAND ALL
      SELECT ALL
      # Remember to change Regional Settings Date Separater from / to -
      # The next command copies it to a dated folder
      COPYTO LEFT C:\Archive\%date%

      This copies all my .bak files to a dated archive folder, keeping the directory structure (ex: C:\Archive\2005-02-25\etc\etc).

      Now all I have to do is clean up the .bak files.
      I tried:
      DELETE recyclebin=yes ALL
      But I can't get BC2 to delete anything.

      I can put the following line in a .bat file:
      DEL /Q C:\Archive\Temp\*.*
      This will help clean up a little bit, but I need BC2 to delete the .bak files in the original folder (In this example C:\inetpub\wwwroot).

      Comment


      • #4
        Re: COPYTO or MOVE

        Oh my God, I can't believe it.
        I was running this through a batch file with a /leftreadonly parameter because when I originally wrote the batch file I was being extra precautious not to change production.
        I AM SO SORRY!

        Comment

        Working...
        X