Announcement

Collapse
No announcement yet.

Deleting orphans

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

  • Deleting orphans

    I'm running the following script:-

    log verbose "%2.log"
    load %1 "e:\backup\%2"
    option confirm:yes-to-all
    criteria timestamp size timezone:ignore
    expand all
    filter "-*.tmp;-Temp\;-~*.*;-Deleted Items.dbx;-trash;-trash.msf;-junk;-junk.msf;-Junk E-mail"
    select lt.diff lt.newer lt.orphan
    copy lt->rt
    filter "+*.*;+*.*\"
    select rt.orphan
    delete rt
    select rt.files
    touch lt->rt
    This is working well, but the orphans on the right are NOT being deleted. What am I doing wrong?

    Thanks in advance,

    Mark

  • #2
    Re: Deleting orphans

    Try this instead:

    Code:
    log verbose "%2.log"
    option confirm:yes-to-all
    criteria timestamp size timezone:ignore
    filter "-*.tmp;-Temp\;-~*.*;-Deleted Items.dbx;-trash;-trash.msf;-junk;-junk.msf;-Junk E-mail"
    load %1 "e:\backup\%2"
    sync mirror:lt->rt
    The sync mirror command will make the target folder identical to the source folder. This includes deleting orphan files. Also, BC should automatically preserve the timestamps when it copies files, so unless you're having timestamp problems, a separate touch command might not be necessary.
    Chris K Scooter Software

    Comment


    • #3
      Re: Deleting orphans

      One more thing. In your original script, the orphans probably aren't being deleted due to your filter statement.

      You have:
      filter "+*.*;+*.*\"

      The + character isn't used to include items. It is probably matching on files and folders that start with the + character, and because no orphan files start with a + character, no orphans are deleted.

      If instead you use:
      filter *.*

      That should work better.
      Chris K Scooter Software

      Comment

      Working...
      X